How can I analyze the header and body posted by my API call

87 Views Asked by At

In Java, using httpclient5.1.3 and httpcore5.1.3 I'm trying to do a POST request to an API URL. However, I keep receiving a 400 Bad request. Are there any tools so I can debug how the request is exactly received by the API? To see how the headers and body are received exactly?

1

There are 1 best solutions below

0
On BEST ANSWER

You could use Postman or Advanced Rest Client (A plugin for Chrome) that allows you to send HTTP requests and see the responses. There is a tool called Fidler that shows HHTP traffic.

Also there are some other HTTP clients you could use:

  1. Apache Http client - very popular and well known 3d party Http Client
  2. OK Http client - Open-source Http client. Here is tutorial
  3. MgntUtils Http client - very simple 3d party HttpClient: Provided in MgntUtils Open source library (written by me). Very simple in use. Take a look at Javadoc. Library itself provided as Maven artifacts and on Git (including source code and Javadoc).