Interface IHttpRequestBuilder
Used for building HttpRequest.
Namespace:MyTested.AspNetCore.Mvc.Builders.Contracts.Http
Assembly:MyTested.AspNetCore.Mvc.Http.dll
Syntax
public interface IHttpRequestBuilder
Methods
| Improve this Doc View SourceWithBody(Stream)
Adds body to the Microsoft.AspNetCore.Http.HttpRequest.Body.
Declaration
IAndHttpRequestBuilder WithBody(Stream body)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | body | Body as Stream. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithBody<TBody>(TBody, String)
Adds body to the Microsoft.AspNetCore.Http.HttpRequest.Body by trying to format the provided object based on the content type and the configured formatters. Uses System.Text.Encoding.UTF8 encoding.
Declaration
IAndHttpRequestBuilder WithBody<TBody>(TBody body, string contentType)
Parameters
Type | Name | Description |
---|---|---|
TBody | body | Body as object. |
System.String | contentType | Content type to use for formatting. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
Type Parameters
Name | Description |
---|---|
TBody | Type of body. |
WithBody<TBody>(TBody, String, Encoding)
Adds body to the Microsoft.AspNetCore.Http.HttpRequest.Body by trying to format the provided object based on the content type and the configured formatters.
Declaration
IAndHttpRequestBuilder WithBody<TBody>(TBody body, string contentType, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
TBody | body | Body as object. |
System.String | contentType | Content type to use for formatting. |
System.Text.Encoding | encoding | Encoding to use for the body. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
Type Parameters
Name | Description |
---|---|
TBody | Type of body. |
WithContentLength(Nullable<Int64>)
Adds content length to the Microsoft.AspNetCore.Http.HttpRequest.ContentLength.
Declaration
IAndHttpRequestBuilder WithContentLength(long ? contentLength)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Int64> | contentLength | Content length as nullable long. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithContentType(String)
Adds content type to the Microsoft.AspNetCore.Http.HttpRequest.ContentType.
Declaration
IAndHttpRequestBuilder WithContentType(string contentType)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentType | Content type as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithCookie(String, String)
Adds cookie to the Microsoft.AspNetCore.Http.HttpRequest.Cookies.
Declaration
IAndHttpRequestBuilder WithCookie(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Cookie name. |
System.String | value | Cookie value. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithCookies(IRequestCookieCollection)
Adds cookies to the Microsoft.AspNetCore.Http.HttpRequest.Cookies.
Declaration
IAndHttpRequestBuilder WithCookies(IRequestCookieCollection cookies)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.IRequestCookieCollection | cookies | Request cookie collection. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithCookies(IDictionary<String, String>)
Adds cookies to the Microsoft.AspNetCore.Http.HttpRequest.Cookies.
Declaration
IAndHttpRequestBuilder WithCookies(IDictionary<string, string> cookies)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | cookies | Dictionary of name-value cookies. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithCookies(Object)
Adds cookies to the Microsoft.AspNetCore.Http.HttpRequest.Cookies.
Declaration
IAndHttpRequestBuilder WithCookies(object cookies)
Parameters
Type | Name | Description |
---|---|---|
System.Object | cookies | Anonymous object of name-value cookies. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithForm(IFormCollection)
Adds form values and files to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithForm(IFormCollection formCollection)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.IFormCollection | formCollection | Form collection to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormField(String, StringValues)
Adds form field to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormField(string name, StringValues values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the form field. |
Microsoft.Extensions.Primitives.StringValues | values | Collection of string values for the form field. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormField(String, IEnumerable<String>)
Adds form field to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormField(string name, IEnumerable<string> values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the form field. |
System.Collections.Generic.IEnumerable<System.String> | values | Collection of values for the form field. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormField(String, String)
Adds form field to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormField(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the form field. |
System.String | value | Value of the form field. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormField(String, String[])
Adds form field to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormField(string name, params string[] values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the form field. |
System.String[] | values | Collection of values for the form field. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormFields(IDictionary<String, StringValues>)
Adds form fields to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormFields(IDictionary<string, StringValues> formValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, Microsoft.Extensions.Primitives.StringValues> | formValues | Dictionary of form fields to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormFields(IDictionary<String, IEnumerable<String>>)
Adds form fields to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormFields(IDictionary<string, IEnumerable<string>> formValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<System.String>> | formValues | Dictionary of form fields to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormFields(IDictionary<String, String>)
Adds form fields to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormFields(IDictionary<string, string> formValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | formValues | Dictionary of form fields to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormFields(Object)
Adds form fields to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormFields(object formValues)
Parameters
Type | Name | Description |
---|---|---|
System.Object | formValues | Anonymous object of form fields to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormFile(IFormFile)
Adds form file to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormFile(IFormFile formFile)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.IFormFile | formFile | Form file to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormFiles(IFormFile[])
Adds form files to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormFiles(params IFormFile[] formFiles)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.IFormFile[] | formFiles | Form file parameters. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithFormFiles(IEnumerable<IFormFile>)
Adds form files to the Microsoft.AspNetCore.Http.HttpRequest.Form.
Declaration
IAndHttpRequestBuilder WithFormFiles(IEnumerable<IFormFile> formFiles)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Http.IFormFile> | formFiles | Collection of form files. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeader(String, StringValues)
Adds header to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeader(string name, StringValues values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the header. |
Microsoft.Extensions.Primitives.StringValues | values | Collection of string values for the header. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeader(String, IEnumerable<String>)
Adds header to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeader(string name, IEnumerable<string> values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the header. |
System.Collections.Generic.IEnumerable<System.String> | values | Collection of values for the header. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeader(String, String)
Adds header to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeader(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the header. |
System.String | value | Value of the header. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeader(String, String[])
Adds header to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeader(string name, params string[] values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the header. |
System.String[] | values | Collection of values for the header. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeaders(IHeaderDictionary)
Adds collection of headers to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeaders(IHeaderDictionary headers)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.IHeaderDictionary | headers | Dictionary of headers to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeaders(IDictionary<String, StringValues>)
Adds collection of headers to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeaders(IDictionary<string, StringValues> headers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, Microsoft.Extensions.Primitives.StringValues> | headers | Dictionary of headers to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeaders(IDictionary<String, IEnumerable<String>>)
Adds collection of headers to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeaders(IDictionary<string, IEnumerable<string>> headers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<System.String>> | headers | Dictionary of headers to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeaders(IDictionary<String, String>)
Adds collection of headers to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeaders(IDictionary<string, string> headers)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | headers | Dictionary of headers to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHeaders(Object)
Adds collection of headers to the Microsoft.AspNetCore.Http.HttpRequest.Headers.
Declaration
IAndHttpRequestBuilder WithHeaders(object headers)
Parameters
Type | Name | Description |
---|---|---|
System.Object | headers | Anonymous object of headers to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHost(HostString)
Adds host to the Microsoft.AspNetCore.Http.HttpRequest.Host.
Declaration
IAndHttpRequestBuilder WithHost(HostString host)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.HostString | host | Host as HostString. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHost(String)
Adds host to the Microsoft.AspNetCore.Http.HttpRequest.Host.
Declaration
IAndHttpRequestBuilder WithHost(string host)
Parameters
Type | Name | Description |
---|---|---|
System.String | host | Host as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithHttps()
Adds HTTPS scheme to the Microsoft.AspNetCore.Http.HttpRequest.Scheme.
Declaration
IAndHttpRequestBuilder WithHttps()
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithJsonBody(Object)
Adds JSON body to the Microsoft.AspNetCore.Http.HttpRequest.Body. If no content type is set on the request, 'application/json' will be used. Uses System.Text.Encoding.UTF8 encoding.
Declaration
IAndHttpRequestBuilder WithJsonBody(object jsonBody)
Parameters
Type | Name | Description |
---|---|---|
System.Object | jsonBody | Object to serialize using the built-in JSON formatters in ASP.NET Core MVC. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithJsonBody(Object, Encoding)
Adds JSON body to the Microsoft.AspNetCore.Http.HttpRequest.Body. If no content type is set on the request, 'application/json' will be used.
Declaration
IAndHttpRequestBuilder WithJsonBody(object jsonBody, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.Object | jsonBody | Object to serialize using the built-in JSON formatters in ASP.NET Core MVC. |
System.Text.Encoding | encoding | Encoding to use for the body. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithJsonBody(String)
Adds JSON body to the Microsoft.AspNetCore.Http.HttpRequest.Body. Sets 'application/json' to the content type. Uses System.Text.Encoding.UTF8 encoding.
Declaration
IAndHttpRequestBuilder WithJsonBody(string jsonBody)
Parameters
Type | Name | Description |
---|---|---|
System.String | jsonBody | JSON body as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithJsonBody(String, Encoding)
Adds JSON body to the Microsoft.AspNetCore.Http.HttpRequest.Body. If no content type is set on the request, 'application/json' will be used.
Declaration
IAndHttpRequestBuilder WithJsonBody(string jsonBody, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.String | jsonBody | JSON body as string. |
System.Text.Encoding | encoding | Encoding to use for the body. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithLocation(Action<IUriBuilder>)
Adds all URI components to the HttpRequest by extracting them from the provided location.
Declaration
IAndHttpRequestBuilder WithLocation(Action<IUriBuilder> uriBuilder)
Parameters
Type | Name | Description |
---|---|---|
System.Action<IUriBuilder> | uriBuilder | Builder for the URI. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithLocation(String)
Adds all URI components to the HttpRequest by extracting them from the provided location.
Declaration
IAndHttpRequestBuilder WithLocation(string location)
Parameters
Type | Name | Description |
---|---|---|
System.String | location | Location as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithLocation(Uri)
Adds all URI components to the HttpRequest by extracting them from the provided location.
Declaration
IAndHttpRequestBuilder WithLocation(Uri location)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | location | Location as Uri. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithMethod(String)
Adds method to the Microsoft.AspNetCore.Http.HttpRequest.Method.
Declaration
IAndHttpRequestBuilder WithMethod(string method)
Parameters
Type | Name | Description |
---|---|---|
System.String | method | HTTP method represented by string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithPath(PathString)
Adds path to the Microsoft.AspNetCore.Http.HttpRequest.Path.
Declaration
IAndHttpRequestBuilder WithPath(PathString path)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.PathString | path | Path as PathString. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithPath(String)
Adds path to the Microsoft.AspNetCore.Http.HttpRequest.Path.
Declaration
IAndHttpRequestBuilder WithPath(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithPathBase(PathString)
Adds path base to the Microsoft.AspNetCore.Http.HttpRequest.PathBase.
Declaration
IAndHttpRequestBuilder WithPathBase(PathString pathBase)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.PathString | pathBase | Path base as PathString. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithPathBase(String)
Adds path base to the Microsoft.AspNetCore.Http.HttpRequest.PathBase.
Declaration
IAndHttpRequestBuilder WithPathBase(string pathBase)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathBase | Path base as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithProtocol(String)
Adds protocol to the Microsoft.AspNetCore.Http.HttpRequest.Protocol.
Declaration
IAndHttpRequestBuilder WithProtocol(string protocol)
Parameters
Type | Name | Description |
---|---|---|
System.String | protocol | Protocol as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(IQueryCollection)
Adds collection of query values to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(IQueryCollection query)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.IQueryCollection | query | Dictionary of query values to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(IDictionary<String, StringValues>)
Adds collection of query values to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(IDictionary<string, StringValues> query)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, Microsoft.Extensions.Primitives.StringValues> | query | Dictionary of query values to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(IDictionary<String, IEnumerable<String>>)
Adds collection of query values to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(IDictionary<string, IEnumerable<string>> query)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.Collections.Generic.IEnumerable<System.String>> | query | Dictionary of query values to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(IDictionary<String, String>)
Adds collection of query values to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(IDictionary<string, string> query)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | query | Dictionary of query values to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(Object)
Adds collection of query values to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(object query)
Parameters
Type | Name | Description |
---|---|---|
System.Object | query | Anonymous object of query values to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(String, StringValues)
Adds query value to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(string name, StringValues values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the query. |
Microsoft.Extensions.Primitives.StringValues | values | Collection of string values for the query. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(String, IEnumerable<String>)
Adds query value to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(string name, IEnumerable<string> values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the query. |
System.Collections.Generic.IEnumerable<System.String> | values | Collection of values for the query. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(String, String)
Adds query value to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the query. |
System.String | value | Value of the query. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQuery(String, String[])
Adds query value to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQuery(string name, params string[] values)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the query. |
System.String[] | values | Collection of values for the query. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQueryString(QueryString)
Adds query string to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQueryString(QueryString queryString)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.QueryString | queryString | Query string as QueryString. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithQueryString(String)
Adds query string to the Microsoft.AspNetCore.Http.HttpRequest.Query.
Declaration
IAndHttpRequestBuilder WithQueryString(string queryString)
Parameters
Type | Name | Description |
---|---|---|
System.String | queryString | Path base as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithScheme(String)
Adds scheme to the Microsoft.AspNetCore.Http.HttpRequest.Scheme.
Declaration
IAndHttpRequestBuilder WithScheme(string scheme)
Parameters
Type | Name | Description |
---|---|---|
System.String | scheme | Scheme to add. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithStringBody(String)
Adds string body to the Microsoft.AspNetCore.Http.HttpRequest.Body. If no content type is set on the request, 'text/plain' will be used. Uses System.Text.Encoding.UTF8 encoding.
Declaration
IAndHttpRequestBuilder WithStringBody(string body)
Parameters
Type | Name | Description |
---|---|---|
System.String | body | Body as string. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |
WithStringBody(String, Encoding)
Adds string body to the Microsoft.AspNetCore.Http.HttpRequest.Body. If no content type is set on the request, 'text/plain' will be used.
Declaration
IAndHttpRequestBuilder WithStringBody(string body, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.String | body | Body as string. |
System.Text.Encoding | encoding | Encoding to use for the body. |
Returns
Type | Description |
---|---|
MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder | The same MyTested.AspNetCore.Mvc.Builders.Contracts.Http.IAndHttpRequestBuilder. |