LeoNegi
LeoNegi

Reputation: 51

How to read status code from response body of c# webclient request

I am uploading data to my third party API and getting a byte[] as response. I need to read the status code from my response body as to if I am getting status code as 200 or not or if it was successfully uploaded or not. Any suggestions.

Code snippet.

var response = webClient.UploadData(postURL, "POST", formData);

response is coming as a byte[]. On using, Encoding.ASCII.GetString(resp); I simply get all the data in string format.

Upvotes: 0

Views: 72

Answers (0)

Related Questions