Skip to content

Cannot get HttpWebResponse. #11

@SniperED007

Description

@SniperED007

On the client when using GZipWebClient and throwing an error on the server like so:
return new HttpResponseMessage(HttpStatusCode.NotAcceptable);

the error message on the client always fails with the below on this line:
WebException we = (WebException)e.Error;
HttpWebResponse response = (System.Net.HttpWebResponse)we.Response;

Message:

InnerException = {System.NullReferenceException: Object reference not set to an instance of an object.
at System.Net.WebClient.DownloadBitsState.SetResponse(WebResponse response)
at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)}

Message = "An exception occurred during a WebClient request. "

This work fine when using standard WebClient, is there some other way I to successfully get the HttpWebResponse ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions