Show / Hide Table of Contents

Class HttpRequestMessageFactory

A factory.

Inheritance
System.Object
HttpRequestMessageFactory
Implements
IHttpRequestMessageFactory
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Geko.HttpClientService.Infrastructure
Assembly: Geko.HttpClientService.dll
Syntax
public class HttpRequestMessageFactory : IHttpRequestMessageFactory

Constructors

| Improve this Doc View Source

HttpRequestMessageFactory(IHttpContextAccessor, IOptions<HttpClientServiceOptions>)

Constructor of the HttpRequestMessageFactory

Declaration
public HttpRequestMessageFactory(IHttpContextAccessor httpContextAccessor, IOptions<HttpClientServiceOptions> options)
Parameters
Type Name Description
Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor

The Microsoft.AspNetCore.Http.HttpContextAccessor object to access Microsoft.AspNetCore.Http.HttpContext.

Microsoft.Extensions.Options.IOptions<HttpClientServiceOptions> options

The HttpClientService options to use.

Methods

| Improve this Doc View Source

CreateRequestMessage()

Adds an X-HttpClientService header in the newly created by copying the X-HttpClientService of the current request. If there is no current request or the current request does not contain a X-HttpClientService header, it creates a new one.

Declaration
public HttpRequestMessage CreateRequestMessage()
Returns
Type Description
HttpRequestMessage

An to be used by an .

Remarks

This is useful to track in the logs a series of cascading requests between services.

Implements

IHttpRequestMessageFactory
  • Improve this Doc
  • View Source
Back to top Generated by DocFX