Extension methods for HttpRequest
More...
|
static void | SetHeader (this HttpResponse response, string key, string value) |
| Adds a header to the HttpResponse message More...
|
|
static Task< string > | GetBodyAsync (this HttpResponse response) |
| Retrieves the body of a request as a string More...
|
|
static Task | ReplaceBodyAsync (this HttpResponse response, string str) |
| Retrieves the body of a response as a string More...
|
|
static Task | WriteResponseAsync (this HttpResponse response, IApiResponse obj, JsonSerializerSettings json) |
| Writes out a custom response More...
|
|
Extension methods for HttpRequest
◆ GetBodyAsync()
static Task<string> Sphyrnidae.Common.Extensions.HttpResponseExtensions.GetBodyAsync |
( |
this HttpResponse |
response | ) |
|
|
static |
Retrieves the body of a request as a string
Can't read a PipeWriter, so continue to do this one as a stream
- Parameters
-
response | The current http response |
- Returns
- The full body of the request
◆ ReplaceBodyAsync()
static Task Sphyrnidae.Common.Extensions.HttpResponseExtensions.ReplaceBodyAsync |
( |
this HttpResponse |
response, |
|
|
string |
str |
|
) |
| |
|
static |
Retrieves the body of a response as a string
- Parameters
-
response | The current http response |
str | The string value of the body (usually object serialized to json) |
◆ SetHeader()
static void Sphyrnidae.Common.Extensions.HttpResponseExtensions.SetHeader |
( |
this HttpResponse |
response, |
|
|
string |
key, |
|
|
string |
value |
|
) |
| |
|
static |
Adds a header to the HttpResponse message
- Parameters
-
response | The current http response |
key | The name of the header |
value | The value of the header |
◆ WriteResponseAsync()
static Task Sphyrnidae.Common.Extensions.HttpResponseExtensions.WriteResponseAsync |
( |
this HttpResponse |
response, |
|
|
IApiResponse |
obj, |
|
|
JsonSerializerSettings |
json |
|
) |
| |
|
static |
Writes out a custom response
- Parameters
-
response | The current http response |
obj | The object to write out |
json | Json serialization settings |
- Returns
The documentation for this class was generated from the following file:
- C:/Users/dougb/Desktop/Sphyrnidae/New/Common/Common/Extensions/HttpResponseExtensions.cs