API auth works for GET but not for POST (php curl)

I’m accessing the API in a php script using php’s curl. I set the username:password in the CURLOPT_USERPWD option and it works fine for a GET request. But when I try a POST request I get an “Unable to authenticate user” message in the response.
On the server the production.log file shows that the user is authorized for the GET request but the POST request shows an SSO failed error.

The user is an internal user created for API calls and it has the System Admin role. Is there some setting I need to change in the settings.yaml file that allows the user to perform POST requests?

Foreman version 2.2.3

2021-09-01T13:14:13 [I|app|6f808ed3] invalid user
2021-09-01T13:14:13 [W|app|6f808ed3] SSO failed

Are you by any chance receiving some redirect and it follows that?

It turns out that I fat-fingered the password in my code. Now I’m able to GET and POST but PUT isn’t working when I try to update a host. But that’s a different problem, not an auth problem. Thanks for the reply.