loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Spring Rest Template error :org.springframework.web.client.HttpClientErrorException: 422

Open reddynr opened this issue 8 years ago • 3 comments

Description/Steps to reproduce

Review review = new Review("Captical market Error",ZonedDateTime.now(),"Marker"); List reviews= new ArrayList(); reviews.add(review); HttpEntity request1 = new HttpEntity<>(new ReviewPayload("OME","2018-08-03",reviews)); HttpHeaders headers = new HttpHeaders(); headers.add("Content-Type", "application/x-www-form-urlencoded"); HttpEntity entity = new HttpEntity<>("username=userId&password=pwd", headers);

ResponseEntity response = restTemplate.exchange( "https://se2345.personalfg.my.com:8446//login", HttpMethod.POST, entity, MyPayload.class);

ResponseEntity response2 = restTemplate .exchange("https://se2345.personalfg.my.com:8446/api/reviews", HttpMethod.POST, request1, MyPayload.class);

Link to reproduction sandbox

Expected result

Additional information

reddynr avatar Aug 03 '18 20:08 reddynr

@reddynr Can you post what you were expecting and what is happening?

hacksparrow avatar Aug 07 '18 09:08 hacksparrow

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 18 '19 00:09 stale[bot]

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

stale[bot] avatar Oct 02 '19 01:10 stale[bot]