Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

You must login to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Passionable Logo Passionable Logo
Sign InSign Up

Passionable

Passionable Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • New Questions
  • Trending Questions
  • Must read Questions
  • Hot Questions
Home/ Questions/Q 7564
In Process
Alek Richter
  • 0
Alek RichterEnlightened
Asked: December 25, 20212021-12-25T13:39:55+00:00 2021-12-25T13:39:55+00:00

How to send a header using a HTTP request through a cURL call?

  • 0

I wish to send a header to my Apache server on a Linux box. How can I achieve this via a cURL call?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
    • Report
  • Share
    Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Alek Richter Enlightened
    2021-12-25T13:40:16+00:00Added an answer on December 25, 2021 at 1:40 pm

    man curl:

    -H/–header
    (HTTP) Extra header to use when getting a web page. You may specify
    any number of extra headers. Note that if you should add a custom
    header that has the same name as one of the internal ones curl would
    use, your externally set header will be used instead of the internal
    one. This allows you to make even trickier stuff than curl would
    normally do. You should not replace internally set headers without
    knowing perfectly well what you’re doing. Remove an internal header
    by giving a replacement without content on the right side of the
    colon, as in: -H “Host:”.

    curl will make sure that each header you add/replace get sent with
    the proper end of line marker, you should thus not add that as a
    part of the header content: do not add newlines or carriage returns
    they will only mess things up for you.

    See also the -A/–user-agent and -e/–referer options.

    This option can be used multiple times to add/replace/remove multi-
    ple headers.

    Example:

    curl –header “X-MyHeader: 123” http://www.google.com

    You can see the request that curl sent by adding the -v option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 4k
  • Best Answers 0
  • Users 200
  • Popular
  • Answers
  • Alek Richter

    How do I add sockets to an item?

    • 2 Answers
  • Alek Richter

    Dialog throwing "Unable to add window — token null is ...

    • 2 Answers
  • Alek Richter

    Is the Glamour College Bard's Mantle of Inspiration Overpowered?

    • 2 Answers
  • Alek Richter
    Alek Richter added an answer Pandas DataFrame columns are Pandas Series when you pull them… January 13, 2022 at 2:21 pm
  • Alek Richter
    Alek Richter added an answer The handshake failure could have occurred due to various reasons:… January 13, 2022 at 2:19 pm
  • Alek Richter
    Alek Richter added an answer Mac OS X doesn't have apt-get. There is a package… January 13, 2022 at 2:18 pm

Top Members

Alek Richter

Alek Richter

  • 4k Questions
  • 1k Points
Enlightened
fayemolloy0

fayemolloy0

  • 0 Questions
  • 20 Points
Begginer
NikolaZex

NikolaZex

  • 0 Questions
  • 20 Points
Begginer

Trending Tags

questin question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • New Questions
  • Trending Questions
  • Must read Questions
  • Hot Questions

© 2021 Passionable. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.