BillOatman 575 Posted May 31, 2019 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
Luke 40077 Posted May 31, 2019 Posted May 31, 2019 That seems to look correct. what are the differences in the response bodies?
Solution BillOatman 575 Posted June 1, 2019 Author Solution 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
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