How do I track incoming rest request values

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

How do I track incoming rest request values

Post by swiftinitpvtltd »

I have external system sending data to aware via
http://myserver.com:8080/AwareIM/REST/C ... am2=value2
In process called via rest how do I track whats coming in? I am able to make it work via post via my browser but third party post is throwing an error and I want to check whats coming in via rest request to aware IM.
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: How do I track incoming rest request values

Post by swiftinitpvtltd »

In logs I am getting below error only when posting via third party, if I post via my browser it works-

PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [RESTServlet] in context with path [/myapp] threw exception [java.lang.Exception: Unrecognized content type application/x-www-form-urlencoded; charset=utf-8 in the body of the request] with root cause
java.lang.Exception: Unrecognized content type application/x-www-form-urlencoded; charset=utf-8 in the body of the request
at com.bas.webapp.thin.servlets.RESTServlet.A(Unknown Source)
at com.bas.webapp.thin.servlets.RESTServlet.A(Unknown Source)
at com.bas.webapp.thin.servlets.RESTServlet.A(Unknown Source)
at com.bas.webapp.thin.servlets.RESTServlet.A(Unknown Source)
at com.bas.webapp.thin.servlets.RESTServlet.doPost(Unknown Source)
craigd
Posts: 17
Joined: Fri Nov 16, 2018 7:07 am
Location: Canada

Re: How do I track incoming rest request values

Post by craigd »

have you tried via Postman or similar tool so you can control exactly what headers are sent and see what the HTTP (error) response is. Browsers sometimes hide the details because they may already have cached tokens and default headers so it's hard to know what worked or not when using the browser.

That said, in my REST 'GET' tests with Postman, I had no headers (except the defaults that Postman adds (postman-token,cache-control) and it worked fine.
Post Reply