0

I have end point URL, and sample JSON request payload, when I tried to hit(POST) the end point URL through postman it's responding back that the Username field is missing in request payload. But the same request payload is working fine with our internal tool which is used to call the same end-point URL. Even though I set the basic authentication in postman, but still observed the same error message.

Is there any way to identify the sample request payload by using end point URL? or any other way to identify the root cause for this issue and what would be the fix?

ArrchanaMohan
  • 2,314
  • 4
  • 36
  • 84
  • 1
    API documentation of producer? – dev2d Oct 05 '17 at 04:34
  • I'm slightly confused by your explanation. Is the service demanding basic authentication? If so the credentials need to be passed within an `Authorization` header whose value starts with `Basic ` and followed by a base64 encoded version of `username:password`. You should further check if your internal tool is sending the credentials preemptively which your postman might not. If the credentials, however, are required in the body than basic auth will not work. – Roman Vottner Oct 05 '17 at 12:14
  • I added basic authentication in header too. But still facing this issue. Also, for this case I have defined request payload which doesn't have username field, but everything fine with internal tool. no need any basic authentication too in that tool. – ArrchanaMohan Oct 05 '17 at 12:18

4 Answers4

1

RESTful web services aren't like SOAP ones where you can grab the WSDL and be (almost certainly!) sure about the expected inputs and outputs. Documenting the request/response structure of a RESTful web service is entirely up to the vendor/maintainer (see Should a RESTful API have a schema?).

If you're 100% sure that you're using Postman correctly, I'd suggest:

  1. Using a tool like Wireshark to look at what's getting sent over the wire
  2. Using curl or another tool as a second (third?) opinion on the matter
Catchwa
  • 5,845
  • 4
  • 31
  • 57
1

As you mentioned in your Question that your URL is responding back that the

'Username' field is missing in request payload

And, it is working fine with your internal tool to hit the same URL, I recommend you should check the Payload which you are sending in your POST Request.

As per the error response obtained, you are not sending 'Username' in your payload which is necessary for the POST Request to complete.

I'd recommend you to check once again:

  1. The Payload that your are sending via POSTMAN and compare that payload to the one you send through your internal tool.
  2. Also, check if some additional Headers are being sent by your internal tool in the POST Request which you might be missing to send via POSTMAN.
Abhay Bh
  • 139
  • 1
  • 4
  • 16
1

if you want to see the request payload, you may have a look at this in paragraph "Request/response related properties" You can check headers, data, url etc. by doing ie.

console.log(request.data)
A.Joly
  • 2,317
  • 2
  • 20
  • 25
0

postman request body

Since you are using a post request to pass the username and password to the api you have to specify it as a post body, and the picture above shows how to do that with postman.

oziomajnr
  • 1,671
  • 1
  • 15
  • 39