Closed HideakiAtsuyo closed 4 years ago
var jsonContent = new StringContent("{\"json\": true}") {
ContentType = "application/json"
};
// content is optional and also can be as form or multipart form
var resp = HttpRequest.Raw(HttpMethod.PATCH, new Uri("https://google.com/test", jsonContent);
string respStr = resp.ToString();
impossible conversion from 'Leaf.xNet.StringContent' to 'bool'.
for the jsonContent in new Uri
He forgot to put bracket but i think it's easy to find out what parameters Raw method takes.
var jsonContent = new StringContent("{\"json\": true}")
{
ContentType = "application/json"
};
// content is optional and also can be as form or multipart form
var resp = req.Raw(HttpMethod.PATCH, "https://google.com/test", jsonContent);
string respStr = resp.ToString();
Working but how can i find the status code response with leaf xnet?? I don't can see him only for Exception
Raw method or any of Get/Post/Put method returns HttpResponse which does have status code and all required stuff you would need. Here we have assigned 'resp' variable for response so check that to get status code.
Yeah i have it with request.Response.StatusCode
thanks solved
How to send body in Patch request