BillOatman 492 Posted May 31, 2019 Share Posted May 31, 2019 (edited) I have the following C# line that seems to work properly to send a string formatted as json : using (var client = new HttpClient()) { var httpContent = new StringContent(data, Encoding.UTF8, "application/json"); response = client.PutAsync(new Uri(sceneUrl), httpContent).Result; } What would produce the same thing in the plugin httpclient interface ? I tried this: await _httpClient.SendAsync(new HttpRequestOptions { Url = url, RequestContent = jsonData.AsMemory(), RequestContentType = "application/json" }, "PUT"); Would I need to put the json elements of the string into this call of HttpRequestOptions or something? public void SetPostData(IDictionary<string, string> values); Right now the receiver is not understanding the command from the plugin. When I look at both requests in wireshark, the C# one shows the data going out as an object and the plugin is not. Edited June 1, 2019 by BillOatman Link to comment Share on other sites More sharing options...
Luke 36876 Posted May 31, 2019 Share Posted May 31, 2019 That seems to look correct. what are the differences in the response bodies? Link to comment Share on other sites More sharing options...
Solution BillOatman 492 Posted June 1, 2019 Author Solution Share Posted June 1, 2019 Uggggggggg. It's always the stupid things. I didn't have quotes around a string value in the json. Thanks for looking Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now