change GET to POST for login flow v2
This commit is contained in:
@@ -120,8 +120,13 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
|
||||
if (responseInit != null)
|
||||
{
|
||||
var bodyInit = responseInit.Content.ReadAsStringAsync().Result;
|
||||
return JsonConvert.DeserializeObject<TResponse>(bodyInit);
|
||||
try
|
||||
{
|
||||
var bodyInit = responseInit.Content.ReadAsStringAsync().Result;
|
||||
return JsonConvert.DeserializeObject<TResponse>(bodyInit);
|
||||
}
|
||||
catch(FormatException) { }
|
||||
catch(JsonSerializationException) { }
|
||||
}
|
||||
|
||||
return default;
|
||||
@@ -192,11 +197,15 @@ namespace Pilz.Networking.CloudProviders.Nextcloud.Ocs
|
||||
{
|
||||
{ "Accept", CONTENT_TYPE_JSON },
|
||||
{ "OCS-APIREQUEST", "true" },
|
||||
{ "Authorization", authentication.ToBasicAuth() }
|
||||
//{ "Authorization", authentication.ToBasicAuth() }
|
||||
},
|
||||
Content = httpContent
|
||||
};
|
||||
|
||||
// Add authorization
|
||||
if (authentication != null)
|
||||
request.Headers.Add("Authorization", authentication.ToBasicAuth());
|
||||
|
||||
return client.Send(request);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user