Linked Questions

13 votes
1 answer
34k views

I'm using Spring with RestTemplate to execute HTTP GET requests. How can I log any request and response data to a log file automatically on each request?
membersound's user avatar
  • 87.9k
0 votes
1 answer
340 views

For debugging purposes , I need to retrieve the raw POST request of an restTemplate.postForObject method , is there any way to obtain it before it get send?
Nexussim Lements's user avatar
122 votes
16 answers
160k views

When I try to use a non-standard HTTP Method like PATCH with URLConnection: HttpURLConnection conn = (HttpURLConnection) new URL("http://example.com").openConnection(); conn.setRequestMethod("...
kavai77's user avatar
  • 6,646
46 votes
7 answers
92k views

I've got a maven & spring app that I want logging in. I'm keen to use SLF4J. I want to put all my config files into a directory {classpath}/config including log4j.xml and then init using a spring ...
Programming Guy's user avatar
15 votes
8 answers
41k views

I am using RestTemplate to make calls to a web service. String userId = restTemplate.getForObject(createUserUrl, String.class); If this fails to return a user ID I just get returned null but I don't ...
rjsang's user avatar
  • 1,757
16 votes
2 answers
12k views

I want to chain async rest service calls and have single callback when they finished. Is it possible to do it with guava?
Alexey Zakharov's user avatar
6 votes
2 answers
16k views

I am trying to POST to a REST-API using RestTemplate in Spring. Here is the code I am using: //Code to Post data using Rest Template List<UserVO> userList = getUsers(); RestRequestVO ...
Learn More's user avatar
  • 1,561
5 votes
2 answers
6k views

I'm using latest Eclipse and Sonar plugin In answer for logging there's the following line: log.debug("Request body: {}", new String(body, "UTF-8")); Which should create String only if in DEBUG ...
Ori Marko's user avatar
  • 59.3k
7 votes
1 answer
9k views

my resttemplate.exchange() failed on a POST request, with the server returning a 500 error. I tried to set the root logging level to DEBUG, but nothing was logged before the 500 error was returned. ...
teddy teddy's user avatar
  • 3,095
8 votes
3 answers
18k views

I am trying to log the request-response pairs for every request. The problem is that when the response code is 401, ClientHttpResponse.getBody() throws a ResourceAccessException and i cannot read the ...
Salih Erikci's user avatar
  • 5,095
5 votes
3 answers
13k views

I have a request that is working fine when I try to send through postman. I was trying to implement the same using code where I faced an error. The code i am using - RestTemplate restTemplate = new ...
Parth Manaktala's user avatar
4 votes
3 answers
9k views

I have spring mvc application using RequestBody and ResponseBody annotations. They are configured with MappingJackson2HttpMessageConverter. I also have slf4j set up. I would like to log all json as it ...
Pavel Niedoba's user avatar
7 votes
1 answer
5k views

I have done the following for my custom logging interceptor public class HttpLoggingInterceptor implements ClientHttpRequestInterceptor { private final static Logger log = LoggerFactory.getLogger(...
maya16's user avatar
  • 643
0 votes
3 answers
12k views

I have a service which invokes GET API via RestTemplate. The API is working fine when checked in Postman. it accepts 2 query params fieldList and systemId along with Authorization Token(Bearer) ...
Ullas Sharma's user avatar
2 votes
1 answer
5k views

I'm writing a simple proxy app, and want mapped url will be handled by my controller, but other url (includes error) can be forwarded to another different address. So I use Filter rather than ...
samm's user avatar
  • 820

15 30 50 per page