cloudbet / docs

Public Documentation

Home Page:https://www.cloudbet.com/api/?utm_source=github.com&utm_medium=social&utm_campaign=axis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C# HttpClient 403

sonderangebot10 opened this issue · comments

Hello,

For some weird reason using C# HttpClient I am getting a 403 (forbidden) response. Using python I am getting 200OK on same request. I have tried using NSwag to generate all of the Cloudbet client files, however response is always the same.
image
image

The issue was that on C# I needed to add user-agent header to browser - is there a specific reason to disallow .net? :(

@sonderangebot10 we do expect the user-agent header on all API requests as a basic security feature for our APIs. This is a general requirement. While most languages (e.g. python) and CLI tools (e.g. curl) add the user-agent request header automatically, apparently C# may not (as in your case).

We will mention this requirement in our docs going forward, thanks for bringing it up.

Cheers,
Klaus @ Cloudbet