MY TESTED ASP.NET CORE MVC DOCS
  • Tutorial
  • Testing Guide
  • API Reference
  • Troubleshoot
  • About
  • API Reference
  • MyTested.AspNetCore.Mvc.Builders.Contracts.Http
  • IHttpRequestBuilder
Show / Hide Table of Contents
  • Common Classes & Extensions
    • ActionAttributesTestBuilderViewFeaturesExtensions
    • AuthenticationScheme
    • BadRequestTestBuilderDataAnnotationsExtensions
    • BadRequestTestBuilderExtensions
    • BaseShouldReturnTestBuilderExtensions
    • BaseTestBuilderWithResponseModelExtensions
    • ComponentBuilderAuthenticationExtensions
    • ComponentBuilderCachingExtensions
    • ComponentBuilderDependencyInjectionExtensions
    • ComponentBuilderEntityFrameworkCoreExtensions
    • ComponentBuilderHttpExtensions
    • ComponentBuilderOptionsExtensions
    • ComponentBuilderRoutingExtensions
    • ComponentBuilderSessionExtensions
    • ComponentBuilderTempDataExtensions
    • ComponentShouldHaveTestBuilderCachingExtensions
    • ComponentShouldHaveTestBuilderEntityFrameworkCoreExtensions
    • ComponentShouldHaveTestBuilderHttpExtensions
    • ComponentShouldHaveTestBuilderModelStateExtensions
    • ComponentShouldHaveTestBuilderSessionExtensions
    • ComponentShouldHaveTestBuilderTempDataExtensions
    • ComponentShouldHaveTestBuilderViewBagExtensions
    • ComponentShouldHaveTestBuilderViewDataExtensions
    • ContentType
    • ControllerBuilderDataAnnotationsExtensions
    • CreatedTestBuilderExtensions
    • From
    • HttpHeader
    • HttpMethod
    • HttpRequestBuilderAuthenticationExtensions
    • HttpRequestBuilderViewFeaturesExtensions
    • HttpScheme
    • HttpStatusCode
    • LocalRedirectTestBuilderExtensions
    • ModelErrorDetailsTestBuilderViewFeaturesExtensions
    • ModelErrorTestBuilderViewFeaturesExtensions
    • MyApplication
    • MyController<TController>
    • MyMvc
    • MyRouting
    • MyViewComponent<TViewComponent>
    • RedirectTestBuilderExtensions
    • ResolvedRouteTestBuilderDataAnnotationsExtensions
    • ServiceCollectionAbstractionsExtensions
    • ServiceCollectionCachingExtensions
    • ServiceCollectionControllersExtensions
    • ServiceCollectionCoreExtensions
    • ServiceCollectionEntityFrameworkCoreExtensions
    • ServiceCollectionExtensions
    • ServiceCollectionHttpExtensions
    • ServiceCollectionOptionsExtensions
    • ServiceCollectionRoutingExtensions
    • ServiceCollectionSessionExtensions
    • ServiceCollectionTempDataExtensions
    • ServiceCollectionUniverseExtensions
    • ServiceCollectionViewComponentsExtensions
    • ServiceCollectionViewFeaturesExtensions
    • ShouldReturnTestBuilderExtensions
    • ShouldReturnTestBuilderJsonResultExtensions
    • ShouldReturnTestBuilderPartialViewResultExtensions
    • ShouldReturnTestBuilderViewComponentResultExtensions
    • ShouldReturnTestBuilderViewResultExtensions
    • ViewComponentShouldReturnTestBuilderExtensions
    • With
  • ActionResults.BadRequest
    • IBadRequestErrorMessageTestBuilder
    • IBadRequestTestBuilder
  • ActionResults.Challenge
    • IChallengeTestBuilder
  • ActionResults.Content
    • IContentTestBuilder
  • ActionResults.Created
    • ICreatedTestBuilder
  • ActionResults.File
    • IFileTestBuilder
    • IPhysicalFileTestBuilder
  • ActionResults.Forbid
    • IForbidTestBuilder
  • ActionResults.Json
    • IJsonSerializerSettingsTestBuilder
    • IJsonTestBuilder
  • ActionResults.LocalRedirect
    • ILocalRedirectTestBuilder
  • ActionResults.NotFound
    • INotFoundTestBuilder
  • ActionResults.Object
    • IObjectTestBuilder
  • ActionResults.Ok
    • IOkTestBuilder
  • ActionResults.Redirect
    • IRedirectTestBuilder
  • ActionResults.StatusCode
    • IStatusCodeTestBuilder
  • ActionResults.View
    • IViewComponentTestBuilder
    • IViewTestBuilder
  • Actions
    • IActionResultTestBuilder<TActionResult>
    • IShouldHaveTestBuilder<TActionResult>
    • IShouldReturnTestBuilder<TActionResult>
    • IVoidActionResultTestBuilder
  • Application
    • IApplicationConfigurationBuilder
  • Attributes
    • IActionAttributesTestBuilder
    • IBaseAttributesTestBuilder<TAttributesTestBuilder>
    • IControllerActionAttributesTestBuilder<TAttributesTestBuilder>
    • IControllerAttributesTestBuilder
    • IViewComponentAttributesTestBuilder
  • Authentication
    • IAuthenticationPropertiesTestBuilder
    • IClaimsIdentityBuilder
    • IClaimsPrincipalBuilder
  • Base
    • IBaseTestBuilder
    • IBaseTestBuilderWithAction
    • IBaseTestBuilderWithActionResult<TActionResult>
    • IBaseTestBuilderWithComponent
    • IBaseTestBuilderWithComponentBuilder<TBuilder>
    • IBaseTestBuilderWithComponentShouldHaveTestBuilder<TBuilder>
    • IBaseTestBuilderWithController
    • IBaseTestBuilderWithInvokedAction
    • IBaseTestBuilderWithModel<TModel>
    • IBaseTestBuilderWithModelError
    • IBaseTestBuilderWithResponseModel
    • IBaseTestBuilderWithViewComponent
    • IBaseTestBuilderWithViewComponentInvocation
    • IBaseTestBuilderWithViewComponentResult<TInvocationResult>
  • CaughtExceptions
    • IAggregateExceptionTestBuilder
    • IBaseExceptionTestBuilder
    • IExceptionMessageTestBuilder
    • IExceptionTestBuilder
    • IShouldThrowTestBuilder
  • Controllers
    • IControllerBuilder<TController>
    • IControllerTestBuilder
  • Data
    • IDataProviderEntryDetailsTestBuilder<TValue>
    • IDataProviderEntryKeyTestBuilder
    • IDataProviderEntryTestBuilder
    • IDbContextBuilder
    • IDbContextTestBuilder
    • IMemoryCacheBuilder
    • IMemoryCacheEntryBuilder
    • IMemoryCacheEntryDetailsTestBuilder<TValue>
    • IMemoryCacheEntryKeyBuilder
    • IMemoryCacheEntryKeyTestBuilder
    • IMemoryCacheEntryTestBuilder
    • IMemoryCacheTestBuilder
    • ISessionBuilder
    • ISessionTestBuilder
    • ITempDataBuilder
    • ITempDataTestBuilder
    • IViewBagTestBuilder
    • IViewDataTestBuilder
  • Http
    • IHttpRequestBuilder
    • IHttpResponseTestBuilder
    • IResponseCookieTestBuilder
  • Invocations
    • IBaseShouldReturnTestBuilder
    • IBaseShouldReturnTestBuilder<TInvocationResult, TBuilder>
    • IBaseShouldReturnTestBuilder<TInvocationResult>
    • IViewComponentResultTestBuilder<TInvocationResult>
    • IViewComponentShouldHaveTestBuilder<TInvocationResult>
    • IViewComponentShouldReturnTestBuilder<TInvocationResult>
  • Models
    • IModelDetailsTestBuilder<TModel>
    • IModelErrorDetailsTestBuilder
    • IModelErrorDetailsTestBuilder<TModel>
    • IModelErrorTestBuilder
    • IModelErrorTestBuilder<TModel>
    • IModelStateTestBuilder
  • Options
    • IOptionsBuilder
  • Routing
    • IResolvedRouteTestBuilder
    • IRouteTestBuilder
    • IShouldMapTestBuilder
  • Services
    • IServicesBuilder
  • Uri
    • IUriBuilder
    • IUriTestBuilder
  • ViewComponentResults
    • IViewTestBuilder
  • ViewComponents
    • IViewComponentBuilder<TViewComponent>
    • IViewComponentTestBuilder

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 Source

WithBody(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.

| Improve this Doc View Source

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.
| Improve this Doc View Source

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.
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Extension Methods

HttpRequestBuilderAuthenticationExtensions.WithAuthenticatedUser()
HttpRequestBuilderAuthenticationExtensions.WithAuthenticatedUser(Action<IClaimsPrincipalBuilder>)
HttpRequestBuilderViewFeaturesExtensions.WithAntiForgeryToken()
  • Improve this Doc
  • View Source
In This Article
  • Methods
    • WithBody(Stream)
    • WithBody<TBody>(TBody, String)
    • WithBody<TBody>(TBody, String, Encoding)
    • WithContentLength(Nullable<Int64>)
    • WithContentType(String)
    • WithCookie(String, String)
    • WithCookies(IRequestCookieCollection)
    • WithCookies(IDictionary<String, String>)
    • WithCookies(Object)
    • WithForm(IFormCollection)
    • WithFormField(String, StringValues)
    • WithFormField(String, IEnumerable<String>)
    • WithFormField(String, String)
    • WithFormField(String, String[])
    • WithFormFields(IDictionary<String, StringValues>)
    • WithFormFields(IDictionary<String, IEnumerable<String>>)
    • WithFormFields(IDictionary<String, String>)
    • WithFormFields(Object)
    • WithFormFile(IFormFile)
    • WithFormFiles(IFormFile[])
    • WithFormFiles(IEnumerable<IFormFile>)
    • WithHeader(String, StringValues)
    • WithHeader(String, IEnumerable<String>)
    • WithHeader(String, String)
    • WithHeader(String, String[])
    • WithHeaders(IHeaderDictionary)
    • WithHeaders(IDictionary<String, StringValues>)
    • WithHeaders(IDictionary<String, IEnumerable<String>>)
    • WithHeaders(IDictionary<String, String>)
    • WithHeaders(Object)
    • WithHost(HostString)
    • WithHost(String)
    • WithHttps()
    • WithJsonBody(Object)
    • WithJsonBody(Object, Encoding)
    • WithJsonBody(String)
    • WithJsonBody(String, Encoding)
    • WithLocation(Action<IUriBuilder>)
    • WithLocation(String)
    • WithLocation(Uri)
    • WithMethod(String)
    • WithPath(PathString)
    • WithPath(String)
    • WithPathBase(PathString)
    • WithPathBase(String)
    • WithProtocol(String)
    • WithQuery(IQueryCollection)
    • WithQuery(IDictionary<String, StringValues>)
    • WithQuery(IDictionary<String, IEnumerable<String>>)
    • WithQuery(IDictionary<String, String>)
    • WithQuery(Object)
    • WithQuery(String, StringValues)
    • WithQuery(String, IEnumerable<String>)
    • WithQuery(String, String)
    • WithQuery(String, String[])
    • WithQueryString(QueryString)
    • WithQueryString(String)
    • WithScheme(String)
    • WithStringBody(String)
    • WithStringBody(String, Encoding)
  • Extension Methods
Back to top Copyright © 2015-2016 MyTestedASP.NET. All Rights Reserved. Generated by DocFX