Allow get requests

This commit is contained in:
Zontreck 2023-10-07 22:18:14 -07:00
parent c4e7b6fa54
commit 0a022634c1

View file

@ -17,7 +17,9 @@ namespace LibAC
#pragma warning restore IDE1006 // Naming Styles #pragma warning restore IDE1006 // Naming Styles
{ {
HttpRequestMessage hrm = new HttpRequestMessage(); HttpRequestMessage hrm = new HttpRequestMessage();
hrm.Method = HttpMethod.Post; if (sJson == "") hrm.Method = HttpMethod.Get;
else
hrm.Method = HttpMethod.Post;
hrm.RequestUri = new Uri(url); hrm.RequestUri = new Uri(url);
hrm.Content = new StringContent(sJson, Encoding.UTF8, "application/json"); hrm.Content = new StringContent(sJson, Encoding.UTF8, "application/json");
return HTTP.Request(hrm); return HTTP.Request(hrm);
@ -27,7 +29,9 @@ namespace LibAC
#pragma warning restore IDE1006 // Naming Styles #pragma warning restore IDE1006 // Naming Styles
{ {
HttpRequestMessage hrm = new HttpRequestMessage(); HttpRequestMessage hrm = new HttpRequestMessage();
hrm.Method = HttpMethod.Post; if (sJson == "") hrm.Method = HttpMethod.Get;
else
hrm.Method = HttpMethod.Post;
hrm.RequestUri = new Uri(url); hrm.RequestUri = new Uri(url);
hrm.Headers.Add("X-SecondLife-Owner-Key", xSLOwner); hrm.Headers.Add("X-SecondLife-Owner-Key", xSLOwner);
hrm.Content = new StringContent(sJson, Encoding.UTF8, "application/json"); hrm.Content = new StringContent(sJson, Encoding.UTF8, "application/json");