To make a cURL request with a specific content type header, you can use the -H
or --header
flag followed by the content type header. Here's an example command:
curl -H "Content-Type: application/json" -X POST -d '{"name": "John", "age": 30}' http://example.com/api
In this example, the content type header is set to "application/json"
. The -X
flag is used to specify the HTTP method (POST in this case) and the -d
flag is used to include the request body in the cURL request. Replace http://example.com/api
with the actual endpoint you want to access.