Table of Contents

Class HttpExtensions

Namespace
Cryville.EEW
Assembly
Cryville.EEW.dll
Provides a set of static methods related to HTTP.
public static class HttpExtensions
Inheritance
HttpExtensions
Inherited Members

Methods

EnsureNonErrorStatusCode(HttpResponseMessage, bool, bool)

Throws an exception if the HTTP response has an unaccepted error status code.
public static HttpResponseMessage EnsureNonErrorStatusCode(this HttpResponseMessage response, bool acceptsClientError = false, bool acceptsServerError = false)

Parameters

response HttpResponseMessage
The response message.
acceptsClientError bool
Whether to accept responses with a client error status code (400~499).
acceptsServerError bool
Whether to accept responses with a server error status code (500~599).

Returns

HttpResponseMessage
The response message if there is no unaccepted error.

Exceptions

HttpResponseStatusException
The response has an unaccepted error status code.