0

I'm new to tomcat server technology. Currently I'm working on the spring boot application and I tried calling the below api with the tomcat servers (below 8.5v) running in the background, I got the response as I expected. But when I tried to call the same api with tomcat server 8.5.9v running in the background I'm getting the 400 bad request.

http://localhost:8080/TestRest/ExtractTest?jsonString={"extract": {"Type":"veswanth", "objects":[{"object":"WTT"}]}}

And in the log file I found the below issue

service Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

Kindly help me to fix this issue and correct me if did anything wrong..

Veswanth
  • 1,061
  • 9
  • 22

1 Answers1

0

You can not pass json data in url in that way. You need to pass it in body and request method should be POST.

You can refer this: How to pass a JSON array as a parameter in URL

Aryan
  • 143
  • 1
  • 3
  • I am using GET method in postman so is there any other way using GET method only – Veswanth Oct 04 '17 at 15:23
  • Yes you can use GET method but for this you need to change your URL parameter according to standard defined. Process of doing this is already explained in referred link "https://stackoverflow.com/questions/27577922/how-to-pass-a-json-array-as-a-parameter-in-url" – Aryan Oct 04 '17 at 16:34