Method WithContent
WithContent<THttpResponse>(THttpResponse, string)
Sets an UTF-8 string as the HTTP response content in this HttpResponse.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, string content) where THttpResponse : HttpResponse
Parameters
responseTHttpResponseThe HttpResponse object.
contentstringThe UTF-8 string containing the response body.
Returns
- THttpResponse
The self
THttpResponseobject.
Type Parameters
THttpResponseThe type which implements HttpResponse.
WithContent<THttpResponse>(THttpResponse, string, Encoding?, string)
Sets an string as the HTTP response content in this HttpResponse.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, string content, Encoding? encoding, string mimeType) where THttpResponse : HttpResponse
Parameters
responseTHttpResponseThe HttpResponse object.
contentstringThe string containing the response body.
encodingEncodingThe encoding to encode the string message.
mimeTypestringThe mime-type of the response content.
Returns
- THttpResponse
The self
THttpResponseobject.
Type Parameters
THttpResponseThe type which implements HttpResponse.
WithContent<THttpResponse>(THttpResponse, HttpContent)
Sets an HttpContent as the HTTP content body in this HttpResponse.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, HttpContent content) where THttpResponse : HttpResponse
Parameters
responseTHttpResponseThe HttpResponse object.
contentHttpContentThe HTTP content object.
Returns
- THttpResponse
The self
THttpResponseobject.
Type Parameters
THttpResponseThe type which implements HttpResponse.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語