GET 10% OFF on all Annual Plans. Use Code - FETCH2024

How to send HTTP header using cURL?

Send HTTP Headers using cURL
To send HTTP headers using cURL, you can use the -H or –header option followed by the header information. Here’s an example of how to send HTTP headers using cURL:
				
					curl -H "HeaderName1: HeaderValue1" -H "HeaderName2: HeaderValue2" URL
				
			

Replace HeaderName1 and HeaderValue1 with the name and value of the first header you want to send. Similarly, replace HeaderName2 and HeaderValue2 with the name and value of the second header. You can include as many headers as needed.

Finally, replace URL with the actual URL you want to send the request to.

Here’s an example with sample headers:
				
					curl -H "Content-Type: application/json" -H "Accept: */*" https://api.example.com/endpoint
				
			

In this example, the Content-Type header is set to “application/json” and the Accept header is set to “*/*”. The request is sent to https://api.example.com/endpoint.