Hello guys,
I was trying to achieve something like that last few days..
What do I need. I need to POST data from api to obtain sessionId so I can use api further. Sadly I didn't even achieve to succesfully get 200 response from the api.
Could anyone tell me if I am missing some kind of node?
Curl : curl -X POST "https://api.com/cxf/api/v2/Login" -H "accept: application/json" -H "Content-Type: application/json" -d "{"username":"string","password":"string"}"
C# where it is working as well:
using (var requestToken = new HttpRequestMessage(new HttpMethod("POST"), "https://api.com/cxf/api/v2/Login"))
{
requestToken.Headers.TryAddWithoutValidation("Accept", "application/json");
requestToken.Content = new StringContent("{\"username\":\"username\",\"password\":\"password\"}", Encoding.UTF8, "application/json");
I was trying simple http request with basic authentication / request with added headers.
Anyone who could help me?