I am using Restsharp For Rest Api calls. For one such api, I receive response rawbytes as 0

时间:2018-12-03 13:06:35

标签: restsharp

I am using RestSharp for Rest Api calls. For one such GET api, I receive response header as 404 "Not Found", but response.rawbytes is 0 due to which its response body is blank.

IRestResponse response = client.Execute(request);

This is not the case when using HTTPWebRequest. There response header has 404 status code and body has some content. Response Body with HTTPWebRequest

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /v1/authentication. Reason:
<pre>    Not Found</pre></p>
</body>
</html>

Please help me now if it is a valid behaviour for RestSharp Client?

0 个答案:

没有答案