You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to POST data to some custom endpoints such as the contact API that is not yet implemented with the existing client, i would like to post this kind of JSON
Given the POST method on the Client currently takes a JObject, this is not possible. I would like to submit a pull request with the change of refactoring the RequestAsync method on the client to look like this:
When trying to POST data to some custom endpoints such as the contact API that is not yet implemented with the existing client, i would like to post this kind of JSON
[ { "email": "jones@example.com", "last_name": "Jones", "pet": "Indiana", "age": 25 }, { "email": "miller@example.com", "last_name": "Miller", "pet": "FrouFrou", "age": 32 }, { "email": "invalid_email", "last_name": "Smith", "pet": "Spot", "age": 17 } ]
Given the POST method on the Client currently takes a JObject, this is not possible. I would like to submit a pull request with the change of refactoring the RequestAsync method on the client to look like this:
private async Task<HttpResponseMessage> RequestAsync(Methods method, string endpoint, object data)
And add another method for POST that takes a JArray as a parameter, like this:
public async Task<HttpResponseMessage> Post(string endpoint, JArray data) { return await RequestAsync(Methods.POST, endpoint, data); }
What is everyones thoughts on this? Would this be something you would consider?
The text was updated successfully, but these errors were encountered: