0

I am sending a curl request but i am not setting the host header explicitly. What will be the host header as received by the remote url? Will it be my site's domain, or will be automatically be the domain of the remote url?

2 Answers 2

1

The Host header is automatically set based on the URL of your request.

And it's by definition the Internet hostname of the remote URL.

Sign up to request clarification or add additional context in comments.

Comments

0

If you don't set it, remote server won't receive it. If you send the request as HTTP/1.1, the server should consider it a malformed request, so you'll probably receive an error code.

However, if the backend (e.g. Apache) performs some processing before passing the request to the script, it may set something according to its own logic.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.