Implements a fake http request.
More...
|
override Task< IFormCollection > | ReadFormAsync (CancellationToken cancellationToken=new CancellationToken()) |
| FakeHttpRequest () |
void | SetContext (HttpContext context) |
| Sets the http context for the request.
|
void | SetContextAccessor (Func< HttpContext > accessor) |
| Sets the http context accessor for the request.
|
void | SetHeaders (IHeaderDictionary headers) |
| Sets the headers collection for the request.
|
void | SetUrl (string url) |
| Sets the url components on this request from the provided Url.
|
void | SetUrl (Uri url) |
| Sets the url components on this request from the provided Url.
|
|
override HttpContext | HttpContext [get] |
override string | Method [get, set] |
override string | Scheme [get, set] |
override bool | IsHttps [get, set] |
override HostString | Host = new("localhost") [get, set] |
override PathString | PathBase = new("") [get, set] |
override PathString | Path = new("/") [get, set] |
override QueryString | QueryString [get, set] |
override IQueryCollection | Query [get, set] |
override string | Protocol [get, set] |
override IHeaderDictionary | Headers [get] |
override IRequestCookieCollection | Cookies [get, set] |
override? long | ContentLength = new FakeRequestCookieCollection() [get, set] |
override string | ContentType [get, set] |
override Stream | Body [get, set] |
override bool | HasFormContentType [get] |
override IFormCollection | Form [get, set] |
bool | ContentIsJson [get] |
| Flag: returns true if the body can be deserialized as json.
|
Implements a fake http request.
◆ SetContext()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpRequest.SetContext |
( |
HttpContext | context | ) |
|
Sets the http context for the request.
- Parameters
-
◆ SetContextAccessor()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpRequest.SetContextAccessor |
( |
Func< HttpContext > | accessor | ) |
|
Sets the http context accessor for the request.
- Parameters
-
◆ SetHeaders()
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpRequest.SetHeaders |
( |
IHeaderDictionary | headers | ) |
|
Sets the headers collection for the request.
- Parameters
-
◆ SetUrl() [1/2]
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpRequest.SetUrl |
( |
string | url | ) |
|
Sets the url components on this request from the provided Url.
- Parameters
-
◆ SetUrl() [2/2]
void PeanutButter.TestUtils.AspNetCore.Fakes.FakeHttpRequest.SetUrl |
( |
Uri | url | ) |
|
Sets the url components on this request from the provided Url.
- Parameters
-
The documentation for this class was generated from the following file:
- source/TestUtils/PeanutButter.TestUtils.AspNetCore/Fakes/FakeHttpRequest.cs