How Do I Properly Set a Custom curl Header in My Request? or What’s the Best Way to Pass Headers Usin

20 Replies, 811 Views

curl headers can be finicky af. Your command’s correct, but maybe the server’s picky about order. Try putting `-H "Content-Type: application/json"` *after* the URL.

For multiple headers, yeah, `-H` spam is the norm. No way around it.

If you’re done with curl’s nonsense, `httpie` is a nice alternative. Or use `curl-to-Python` tools to convert your command to code.



Users browsing this thread: 1 Guest(s)