Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 123
    If you want to send multiple headers use more than one --header, it is ok, curl will parse each as a different header. There is no way to separate headers inside the same --header parameter. example: curl --header "Accept: javascript" --header "test: hello" -v www.google.com Commented Sep 24, 2015 at 6:41
  • 5
    If people want examples I'll just leave this here: bropages.org Commented Aug 15, 2016 at 10:57
  • 1
    man pages (on OSX, at least) now DO include an example: Example: # curl -H "X-First-Name: Joe" 192.168.0.1 Commented Apr 6, 2017 at 13:51
  • 9
    @MartinKonicek and others: I HIGHLY recommend the tldr utiltiy (brew, etc install tldr). Its only examples. eg "- Send a request with an extra header, using a custom HTTP method: curl -H 'X-My-Header: 123' -X PUT example.com" Commented Dec 13, 2017 at 16:41
  • For whatever reason, this works for me only if I remove the space after the colon. Commented Dec 9, 2021 at 20:53