Having trouble with curl sending JSON? Need help with the correct syntax and headers!

7 Replies, 1931 Views

Thanks, everyone! I tried escaping the quotes like some of you suggested, and it worked! Turns out the server was super picky about the JSON format.

I also used the `-v` flag, and it helped me see that the server was returning a 400 error because of a missing header. Added an `Authorization` header, and now it’s working perfectly.

Quick question though: does anyone know if there’s a way to pretty-print the JSON response from curl? I’m getting a wall of text, and it’s hard to read.

Thanks again, y’all! You’re lifesavers. 🙌

Messages In This Thread



Users browsing this thread: 2 Guest(s)