resttemplate Questions

3

I have a @Component DataClientImpl that calls a REST API using RestTemplate. The API endpoint has query params, which are passed when calling RestTemplate. There is a @RestClientTest Test class Dat...
Daleth asked 30/11, 2021 at 0:14

5

Context: We have a Spring Boot (2.3.1.RELEASE) web app It's written in Java 8 but running inside of a container with Java 11 (openjdk:11.0.6-jre-stretch). It has a DB connection and an upstream se...
Humdinger asked 12/11, 2020 at 19:41

11

Solved

I have the following definition for PersonDTO: public class PersonDTO { private String id private String firstName; private String lastName; private String maritalStatus; } Here is a sample ...
Nunciata asked 4/4, 2015 at 14:9

3

Solved

I know that similar question has been here already couple of times but following suggested fixes did not solve my problem. I have a simple controller with the following endpoint: @RequestMapping(...
Attribution asked 13/4, 2017 at 13:38

4

Solved

I have a class like that: public class Wrapper<T> { private String message; private T data; public String getMessage() { return message; } public void setMessage(String message) { ...
Disentwine asked 13/11, 2011 at 1:27

5

RestTemplate restTemplate = new RestTemplate(); final MappingJackson2XmlHttpMessageConverter converter = new MappingJackson2XmlHttpMessageConverter(); final List<MediaType> supportedMedia...
Squall asked 2/4, 2015 at 17:9

3

I am upgrading my springboot application from springboot 2.9.7 to springboot 3.0.2. While doing clean build, I am getting below error related to Rest API calls (using Rest template). Caused by: ja...
Scyphus asked 22/5, 2023 at 8:3

4

Solved

I am trying to add common request parameters to every request using RestTemplate. For example if my url is http://something.com/countries/US then I want to add common request param ?id=12345. This...
Savina asked 28/8, 2019 at 16:51

3

Solved

Is there a way to add a query parameter to every HTTP request performed by RestTemplate in Spring? The Atlassian API uses the query parameter os_authType to dictate the authentication method so I'...
Nakashima asked 20/3, 2018 at 21:28

17

Solved

Below is the code snippet. Basically, I am trying to propagate the exception when the error code is anything other than 200. ResponseEntity<Object> response = restTemplate.exchange( url.toSt...
Hodosh asked 29/6, 2016 at 7:46

4

How to make get with body using rest template? Based on question from: POST request via RestTemplate in JSON, I tried make GET with body via HttpEntity (just check if it is possible), but it fail...
Stalnaker asked 10/6, 2020 at 17:31

4

Solved

After I modified Consuming a RESTful Web Service example to call get users by id from api.stackexchange.com I get JsonParseException: com.fasterxml.jackson.core.JsonParseException: Illegal charact...
Grandiloquent asked 22/12, 2015 at 11:41

3

Using Spring Rest Template to upload a 100 MB file, using a multipart post request. Client Code: HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA); ...

30

Solved

I have been using the Spring RestTemplate for a while and I consistently hit a wall when I'am trying to debug it's requests and responses. I'm basically looking to see the same things as I see when...
Stroke asked 31/10, 2011 at 9:58

13

Solved

I am trying to write an integration test where our test launches an embedded HTTPS server using Simple. I created a self-signed certificate using keytool and am able to access the server using a br...
Keel asked 6/5, 2014 at 21:27

16

Solved

I am having two Spring-based web apps A and B, on two different machines. I want to make an HTTPS call from web app A to web app B, however, I am using a self-signed certificate in Machine B. So my...
Mesotron asked 1/11, 2010 at 19:58

7

Solved

I need to retrieve resources from my server by sending a GET request with some Authorization headers using RestTemplate. After going over the docs I noticed that none of the GET methods accepts hea...
Amorete asked 13/1, 2014 at 21:0

3

I am making a post request using a restTemplate and I am getting the following error: unable to find a valid certification path to requested target org.springframework.beans.factory.BeanCreationExc...
Infraction asked 19/8, 2020 at 7:52

7

Solved

I am coding JUnit tests, calling my application via RestTemplate. I have successfully implemented GETs, POSTs, and PUTs, but can not get a PATCH to run (though it works when a client sends in the U...
Undergrown asked 9/1, 2017 at 21:14

6

Solved

As per spring 5: WebClient is an interface representing the main entry point for performing web requests. It has been created as a part of the Spring Web Reactive module and will be replacing the ...
Tameshatamez asked 26/12, 2017 at 6:32

9

I have build a web application using spring mvc framework to publish REST services. For example: @Controller @RequestMapping("/movie") public class MovieController { @RequestMapping(valu...
Amazed asked 6/2, 2013 at 9:55

16

Solved

Using the curl command: curl -u 591bf65f50057469f10b5fd9:0cf17f9b03d056ds0e11e48497e506a2 https://backend.tdk.com/api/devicetypes/59147fd79e93s12e61499ffe/messages I am getting a JSON response: ...
Gramnegative asked 25/5, 2017 at 8:55

4

Spring rest template throws me the following exeption org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [clas...
Conglutinate asked 20/7, 2018 at 11:6

6

Solved

My REST client uses RestTemplate to obtain a List of objects. ResponseEntitiy<List> res = restTemplate.postForEntity(getUrl(), myDTO, List.class); Now I want to use the list returned and r...
Danseuse asked 18/8, 2014 at 1:25

12

Solved

I would like to set the connection timeouts for a rest service used by my web application. I'm using Spring's RestTemplate to talk to my service. I've done some research and I've found and used the...
Pelerine asked 12/12, 2012 at 9:50

© 2022 - 2024 — McMap. All rights reserved.