question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redirected output starts response headers on same line as request body

See original GitHub issue

When I run a POST request without redirection, I see the response headers start on a new line:

            }
        }
    }
}

HTTP/1.1 201
Date: Mon, 21 Dec 2020 13:39:00 GMT
Content-Length: 0

But when I redirect the output, I see the HTTP/1.1 201 on the same line as the request:

            }
        }
    }
}HTTP/1.1 201 
Date: Mon, 21 Dec 2020 13:36:09 GMT
Content-Length: 0

The options I specified in each case were http -v --pretty format --unsorted; the only difference was in the second case I redirected the output to a file.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jakubroztocilcommented, Feb 6, 2021

HTTPie 2.4.0 fixing the incorrect formatting has just been released 🥧

0reactions
jakubroztocilcommented, Jan 25, 2021

@sebastianczech Those are relevant bits indeed. There are quite a few scenarios that need to be handled. What has made things even more complicated, and has introduced this bug, is the new support for streamed uploads with simultaneous terminal output. I’m looking into fixing this, starting with ensuring we have tests for all the scenarios. Will publish soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can PHP cURL retrieve response headers AND body in a ...
For this header you can go around with correctly defining request option: curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); , disabling sending this ...
Read more >
HTTP headers - MDN Web Docs - Mozilla
Request headers contain more information about the resource to be fetched, or about the client requesting the resource. Response headers hold ...
Read more >
PycURL Quick Start — PycURL 7.45.1 documentation
To issue a network request with PycURL, the following steps are required: Create a pycurl. ... Header lines include the first status line...
Read more >
HAProxy version 1.8.30 - Configuration Manual - GitHub Pages
Multiple identical headers may be folded into one single line, delimiting the values with commas, provided that their order is respected. This ...
Read more >
HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found