How to properly use python requests post for sending data? or What's the best way to handle a python

16 Replies, 2004 Views

Had this exact problem yesterday! My fix: the API wanted a trailing slash on the URL.

So `https://example.com/api/` worked but `https://example.com/api` didn’t. Weird, right?

Also, `curl` is your friend. Test the API with curl first to rule out code issues:
```bash
curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://example.com/api
```

Messages In This Thread



Users browsing this thread: 1 Guest(s)