21

I have written an REST API and I'm try to test a request that has no Accept header. If I send a request via Curl it adds a default header Accept: */*, you can see this if you add Curl's -v parameter.

Is there are way to send a request via Curl with no Accept header?

1

1 Answer 1

30

Pass in a header with no value on the right side of the colon to have that removed from the request, even if curl otherwise would add it by itself.

curl -H 'Accept:' http://example.com/
Sign up to request clarification or add additional context in comments.

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.