Class MockHttpServerExtensions
Misc extsnsions.
Namespace: Neon.Xunit
Assembly: Neon.Xunit.dll
Syntax
public static class MockHttpServerExtensions
Methods
GetBodyText(Request)
Returns a request body payload as text.
Declaration
public static string GetBodyText(this Request request)
Parameters
Type | Name | Description |
---|---|---|
Request | request | The request. |
Returns
Type | Description |
---|---|
string | The body text. |
QueryGet(Request, string)
Returns the value of a request query argument.
Declaration
public static string QueryGet(this Request request, string name)
Parameters
Type | Name | Description |
---|---|---|
Request | request | The request. |
string | name | The query argument name. |
Returns
Type | Description |
---|---|
string | The argument value or |
WritAsynce(Response, byte[])
Asynchronously writes bytes to an HTTP response.
Declaration
public static Task WritAsynce(this Response response, byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Response | response | The response. |
byte[] | bytes | The bytes. |
Returns
Type | Description |
---|---|
Task | The tracking Task. |
Write(Response, byte[])
Writes bytes to an HTTP response.
Declaration
public static void Write(this Response response, byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Response | response | The response. |
byte[] | bytes | The bytes. |
Write(Response, byte[], int, int)
Writes bytes to an HTTP response.
Declaration
public static void Write(this Response response, byte[] bytes, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
Response | response | The response. |
byte[] | bytes | The bytes. |
int | offset | The offset of the first byte to write. |
int | count | The number of bytes to be written. |
Write(Response, string)
Writes a string to an HTTP response using UTF-8 encoding.
Declaration
public static void Write(this Response response, string text)
Parameters
Type | Name | Description |
---|---|---|
Response | response | The response. |
string | text | The text to be written. |
WriteAsync(Response, byte[], int, int)
Asynchronously writes bytes to an HTTP response.
Declaration
public static Task WriteAsync(this Response response, byte[] bytes, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
Response | response | The response. |
byte[] | bytes | The bytes. |
int | offset | The offset of the first byte to write. |
int | count | The number of bytes to be written. |
Returns
Type | Description |
---|---|
Task | The tracking Task. |
WriteAsync(Response, string)
Asynchronously writes a string to an HTTP response using UTF-8 encoding.
Declaration
public static Task WriteAsync(this Response response, string text)
Parameters
Type | Name | Description |
---|---|---|
Response | response | The response. |
string | text | The text to be written. |
Returns
Type | Description |
---|---|
Task | The tracking Task. |