Class HttpRequestMessageBuilder
Implements several builder interfaces which enable fluent building of HttpRequestMessage objects.
Implements
Namespace: ReqRest.Builders
Assembly: ReqRest.dll
Syntax
public class HttpRequestMessageBuilder : IHttpRequestMessageBuilder, IHttpHeadersBuilder<HttpRequestHeaders>, IHttpHeadersBuilder, IHttpRequestPropertiesBuilder, IHttpContentBuilder, IHttpProtocolVersionBuilder, IRequestUriBuilder, IHttpMethodBuilder, IBuilder
Constructors
HttpRequestMessageBuilder(Nullable<HttpRequestMessage>)
Initializes a new instance of the HttpRequestMessageBuilder class
which starts building on the specified httpRequestMessage
.
Declaration
public HttpRequestMessageBuilder(HttpRequestMessage? httpRequestMessage = default(HttpRequestMessage? ))
Parameters
Type | Name | Description |
---|---|---|
Nullable<HttpRequestMessage> | httpRequestMessage | The request from which the builder starts building. If null, a new instance is created instead. |
Properties
Content
Gets or sets the HTTP content of the HttpRequestMessage whose properties are being built.
Declaration
public HttpContent? Content { get; set; }
Headers
Gets the collection of HTTP request headers of the HttpRequestMessage whose properties are being built.
Declaration
public HttpRequestHeaders Headers { get; }
HttpRequestMessage
Gets or sets the HttpRequestMessage which is being built.
Declaration
public HttpRequestMessage HttpRequestMessage { get; set; }
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
Method
Gets or sets the HttpMethod of the HttpRequestMessage whose properties are being built.
Declaration
public HttpMethod Method { get; set; }
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
Properties
Gets the set of HTTP properties for the request of the HttpRequestMessage whose properties are being built.
Declaration
public IDictionary<string, object? > Properties { get; }
RequestUri
Gets or sets the request Uri of the HttpRequestMessage whose properties are being built.
Declaration
public Uri? RequestUri { get; set; }
Version
Gets or sets the HTTP message version of the HttpRequestMessage whose properties are being built.
Declaration
public Version Version { get; set; }
Methods
ToString()
Returns a string representing the values of the underlying HttpRequestMessage.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representing the values of the underlying HttpRequestMessage. |
Overrides
Explicit Interface Implementations
IHttpHeadersBuilder.Headers
Gets the collection of HTTP headers which the builder builds.
Declaration
HttpHeaders IHttpHeadersBuilder.Headers { get; }
Returns
Type | Description |
---|---|
HttpHeaders |