"Help! Can't figure out curl post json syntax for my API..."
Hey folks, struggling to get my curl post json request working. Tried a bunch of stuff but keep getting errors or empty responses.
Here's what I'm trying:
```bash
curl -X POST https://api.example.com/data -d '{"name": "test", "value": 123}'
```
But the server acts like it's not even JSON? Am I missing headers or something?
Also, seen people use `-H "Content-Type: application/json"`—is that *always* needed for curl post json?
Would love a *simple* example that actually works. Bonus points if you explain why my version fails.
Thanks in advance! (and pls no "RTFM" replies, I did... kinda 😅)
---
*PS: Using Windows cmd, if that matters. Quotes always mess me up.*
Hey folks, struggling to get my curl post json request working. Tried a bunch of stuff but keep getting errors or empty responses.
Here's what I'm trying:
```bash
curl -X POST https://api.example.com/data -d '{"name": "test", "value": 123}'
```
But the server acts like it's not even JSON? Am I missing headers or something?
Also, seen people use `-H "Content-Type: application/json"`—is that *always* needed for curl post json?
Would love a *simple* example that actually works. Bonus points if you explain why my version fails.
Thanks in advance! (and pls no "RTFM" replies, I did... kinda 😅)
---
*PS: Using Windows cmd, if that matters. Quotes always mess me up.*
