resttemplate Questions
2
higuys!
I have a problem with restTemplate right now.
There are two requests while using this restTemplate.
First one is simple like login.
Other one(the problem) is sending quite long text with po...
Reactionary asked 21/5, 2021 at 6:1
3
I want to make a service with Spring's RestTemplate, in my service side the code is like this :
@PostMapping(path="/savePersonList")
@ResponseBody
public List<Person> generatePersonList(@Re...
Marsiella asked 17/10, 2016 at 5:28
7
Solved
An Abstract controller class requires List of objects from REST. While using Spring RestTemplate its not mapping it to required class instead it returns Linked HashMAp
public List<T> ...
Jamal asked 28/4, 2016 at 13:15
3
Solved
I am trying to POST a file to from one SpringBoot app to anothe SpringBoot app.
The enpoint I am trying to reach looks like
@PostMapping(
value = "/upload",
consumes = MULTIPART_FORM_DATA_VALUE)...
Longanimity asked 13/3, 2019 at 9:37
3
Solved
I am consuming a RESTful JSON API using Spring's RestTemplate and Jackson. In some cases we may receive a Status 401 (Unauthorized) response with a custom JSON body, that is defined by the API manu...
Kirin asked 31/10, 2014 at 13:54
1
Solved
I need to trigger a Jenkins Job from my Java code.The Jenkins API expects a application/x-www-form-urlencoded Content-Type and I am able to trigger the job (using Basic AUTH) from Postman Rest Clie...
Cooking asked 5/4, 2019 at 10:21
2
Solved
I am working on a project in which I need to make a HTTP URL call to my server which is running Restful Service which returns back the response as a JSON String.
Below is my main code which is usi...
Amasa asked 6/9, 2014 at 7:42
9
Solved
I'm writing a simple client in Java to allow reusable use of proprietary virus scanning software accessible through a RESTful API. To upload a file for scanning the API requires a POST for Connect,...
Sigil asked 4/4, 2014 at 4:3
8
Solved
Our REST APIs are returning results in Pages. Here is an example of one Controller
@RequestMapping(value = "/search", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE + ";ch...
Ceporah asked 7/1, 2016 at 4:18
2
Solved
I need to call another api and I am trying to use postForEntity as below:
restTemplate.postForEntity(postUrl, request, responseType)
Now, the api that I am calling is returning an object of a pa...
Hooknose asked 22/6, 2018 at 8:29
4
Solved
I am consuming json webservice using Spring3.0 restTemplate by calling post method.
MultiValueMap<String, String> headers = new LinkedMultiValueMap<String, String>();
headers.add("C...
Tarazi asked 26/8, 2016 at 8:16
6
Can anybody provide me with a code sample to access the rest service URL secured with HTTPS using the Spring Rest template?
I have the certificate, username and password. Basic Authentication is us...
Pattypatulous asked 12/7, 2013 at 16:44
4
Solved
I have written a SpringBoot app that consumes a rest api and presents a rest api. My model pojo's have camelCase named properties. The json that the app consumes has under_score property names. The...
Audiogenic asked 18/3, 2016 at 23:18
3
Solved
I am trying to make a restTemplate.postForObject() without the request body and i am getting bad request.
HttpHeaders headers = new HttpHeaders();
headers.set(HttpHeaders.AUTHORIZATION, "Bearer "...
Veliavelick asked 25/2, 2020 at 10:56
9
Solved
I am using URL class to read an InputStream from it. Is there any way I can use RestTemplate for this?
InputStream input = new URL(url).openStream();
JsonReader reader = new JsonReader(new InputSt...
Landry asked 2/4, 2016 at 23:23
4
The methods of RestTemplate such as postForEntity() throw RestClientException. I would like to extract the HTTP status code and response body from that exception object in the catch block. How can ...
Humid asked 23/9, 2012 at 15:25
0
I've been struggling to properly encode a parameter like this:
filter=startDate eq "2020-08-21T00:00:00+04:30"
So it's encoded like this:
filter=startDate%20eq%20%222020-08-21T00:00:00%2...
Jacquelynnjacquenetta asked 10/11, 2020 at 22:4
1
Solved
Im trying to test a Spring Boot 2.3 @Controller that does metrics via Actuator/Prometheus with @WebMvcTest. Unfortunately this fails with a NPE, probably because the Micrometer/Prometheus classes a...
Role asked 2/11, 2020 at 9:25
4
I have two Spring Boot Services A and B. Also an external service C.
That's the request path:
Web Browser <-> service A <-> Service B <-> External Service C
The external service is retur...
Scincoid asked 17/7, 2018 at 11:2
3
Solved
This is my Configuration for Rest Template,
@Bean
@Qualifier("myRestService")
public RestTemplate createRestTemplate(@Value("${connection.timeout}") String maxConn) {
PoolingHttpClientConnecti...
Chamkis asked 20/10, 2016 at 17:44
1
It seems everywhere around the web there are examples of people autowiring the implementation class RestTemplate rather than it's interface RestOperations. Even in the Spring manuals and documentat...
Martita asked 23/7, 2019 at 14:3
2
I'm trying to consume a rest API call using Spring as below:
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", "Basic " + base64Creds);
HttpEntity<String> request = new ...
Wilser asked 26/2, 2015 at 5:57
6
Solved
I am trying to upload a File using RestTemplate with the following code.
MultiValueMap<String, Object> multipartMap = new LinkedMultiValueMap<>();
multipartMap.add("file", new Class...
Veradia asked 17/11, 2014 at 2:39
2
Im using Spring RestTemplate to make rest call to another service (NodeJS service). Intermittently getting connection reset errors. Same code was working fine with JDK 8 and Spring boot 2.0.1, afte...
Undertone asked 22/8, 2019 at 22:36
2
Solved
I have two different configuration which i would be loading from application yml. The properties are same but the values might differ.
How do i make this work giveMeRestTemplate(Type config)
// app...
Cavender asked 27/7, 2020 at 14:13
© 2022 - 2024 — McMap. All rights reserved.