konedi
Anyone know what is up with HttpClient failing Post request?
It turned out to be the charset=utf-8.... I spent hours on this and did not expect the default content-type application/json that comes with charset=utf-8 to be the issue... sigh I even set the encoding to null on the StringContent object...
17 replies
Anyone know what is up with HttpClient failing Post request?
Thank you, so it just looks like the HttpClient doesn't have the necessary headers. This is a cloudflare Rest API endpoint btw, so it seems like they are really strict. I just don't understand why HttpClient wouldn't have all the default headers and every other program does(python, js, thunderclient(rest client)).
17 replies
Anyone know what is up with HttpClient failing Post request?
error is just a 400 status code and some json schema validation failing on the cloudflare side:
{"errors":[{"message":"AiError: Bad input: must be string, must have required property 'image', must be number, must match exactly one schema in oneOf","code":5006}],"success":false,"result":{},"messages":[]}
same request works everywhere else. Something with the underlying httpclient request pipeline if I had to guess, but haven't been able to figure it out:
Here is the same request with RestSharp:
17 replies