Search code examples
curlpostman

Postman and cURL supposedly truncate a request - how to debug?


I wish to debug Postman app on my machine. On Postman side (request body, console logs) everything looks fine, but reply from the API suggests JS formatting error (unfinished string literal to be exact) and when I asked the API guys to run the trace it turned out said request is truncated: {"key1": "value1", "ke

  1. Any ideas how to check this? All "log in to Postman account" things are no go. Scratchpad only.
  2. While my first thought is to check this USING Postman, other answers that allow me to get to the bottom of it are fine. Wireshark, I guess? Simpler is easier TBH.
  3. I don't have better data to present this ATM. API's proprietary, I can't say what it does, where it is, etc. I don't have a minimum working scenario (yet, I hope) cause I'm in process of making it while keeping the NDA.

UPDATE: curl suffers similarly. And that's just this request!

Content length IS being calculated when the request is processed. Several other requests are going to that API every hour and this seems local to my intuition (unless 50 others do not report this or somehow dealt with it, I did ask, but time zones etc.).

I welcome comments with "try this, try that". Postman version info (hidden quite well! :P):

Postman for Linux
Version 10.11.1
Architecture x64
Platform linux 5.19.0-35-generic 

Solution

  • Content length was the answer.

    Postman has Content-Length header which says it's automatically calculated but the request also had content-length header with a fixed value (it came from a HAR file).

    Curl had issues as the value for the header was taken from the latter.

    If you want to test whether your issue falls under this category:

    1. increase the value so it accurately describes your content length (curl accurately describes how much it sends when you use --trace or --trace-ascii)
    2. play with the content, shortening it. I took out all the formatting, spaces in JSON ("key": "value", "key2": [ "value 2", "value 3" had no spaces except for values), newlines, etc.