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.
How do I track incoming rest request values
-
- Posts: 370
- Joined: Sat Apr 28, 2018 3:33 am
- Location: India
- Contact:
-
- Posts: 370
- Joined: Sat Apr 28, 2018 3:33 am
- Location: India
- Contact:
Re: How do I track incoming rest request values
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)
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)
Re: How do I track incoming rest request values
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.
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.