This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.Http.
Summary
Http Settings to apply to the request
- Assembly
- Cake
.Http .dll - Namespace
- Cake
.Http - Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type["HttpSettings"]
class Type type-node
Syntax
public class HttpSettings
Constructors
Name | Summary |
---|---|
HttpSettings |
Http Settings to apply to the request |
Properties
Name | Value | Summary |
---|---|---|
ClientCertificates | IList |
List of Client Certificates to be enclosed with the http request.
|
Cookies | IDictionary |
Collection of 'Cookie(s)' to append to the http request.
|
Ensure |
bool |
Gets or Sets whether to throw an exception if the returned response is not a Successful Status Code
|
Headers | IDictionary |
Collection of headers to append to the http request
|
Log |
bool |
Determines whether to log the response/request body to the console.
|
RequestBody | byte[] |
Gets or Sets the Body of the Request
|
Throw |
bool |
Gets or Sets where an exception is thrown on non success code.
This is used in conjunction with EnsureSuccessStatusCode.
|
Timeout | Nullable |
Time out for http request, default is 100 seconds reference https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.timeout?view=netcore-3.1
|
Use |
bool |
Gets or sets a value that controls whether default credentials are sent with requests by the handler
|
Extension Methods
Name | Value | Summary |
---|---|---|
AppendCookie |
HttpSettings |
Appends the cookie to the settings cookie collection
Requires the Cake.Http addin
|
AppendHeader |
HttpSettings |
Appends the header to the settings header collection
Requires the Cake.Http addin
|
Dump |
string |
Get a basic string representation of specified object.
From LoggingExtensions
Requires the Cake.Incubator addin
|
Ensure |
HttpSettings |
Sets the EnsureSuccessStatusCode to true. This makes the httpclient throw an error if it does not return a 200 range status.
Requires the Cake.Http addin
|
IsIn |
bool |
Checks if the source is contained in a list
From EnumerableExtensions
Requires the Cake.Incubator addin
|
NotNull |
void |
Throws an exception if the specified parameter's value is null.
From Extensions
Requires the Cake.Ftp addin
|
NotNull |
void |
Throws an exception if the specified parameter's value is null.
From IssuesArgumentChecks
Requires the Cake.Issues addin
|
SetAccept |
HttpSettings |
Sets the accept header of the request.
Requires the Cake.Http addin
|
SetAcceptLanguage |
HttpSettings |
Sets the "Accept-Language" header of the request.
Requires the Cake.Http addin
|
SetAuthorization |
HttpSettings |
Adds a Authorization Header to the request.
Requires the Cake.Http addin
|
SetContentType |
HttpSettings |
Sets the content-type of the request
Requires the Cake.Http addin
|
Set |
HttpSettings |
Sets the request body as form url encoded.
Only valid for Http Methods that allow a request body.
Any existing content in the RequestBody is overridden.
Requires the Cake.Http addin
|
Set |
HttpSettings |
Sets the request body as form url encoded.
Only valid for Http Methods that allow a request body.
Any existing content in the RequestBody is overridden.
Accepts multiple parameters with the same key.
Requires the Cake.Http addin
|
SetJsonRequestBody |
HttpSettings |
Sets the request body from an object. Serialized as JSON
Requires the Cake.Http addin
|
Set |
HttpSettings |
Sets the request body as form url encoded.
Only valid for Http Methods that allow a request body.
Any existing content in the RequestBody is overridden.
Accepts multiple parameters with the same key.
This can be used to post files to a remote URL
Requires the Cake.Http addin
|
Set |
HttpSettings |
Sets the request body as form url encoded.
Only valid for Http Methods that allow a request body.
Any existing content in the RequestBody is overridden.
Accepts multiple parameters with the same key.
This can be used to post files to a remote URL
Requires the Cake.Http addin
|
SetNoCache |
HttpSettings |
Appends a Cache-Control header with no-store
Requires the Cake.Http addin
|
SetOrigin |
HttpSettings |
Sets the origin header to initiate a request for cross-origin resource sharing (asks server for an 'Access-Control-Allow-Origin' response field).
Requires the Cake.Http addin
|
SetReferer |
HttpSettings |
Sets the "Referer" header of the address of the previous web page from which a link to the currently requested page was followed.
Requires the Cake.Http addin
|
SetRequestBody |
HttpSettings |
Sets the request body from a string input
Requires the Cake.Http addin
|
SetTimeout |
HttpSettings |
Sets the timeout for the http request
Requires the Cake.Http addin
|
Suppress |
HttpSettings |
Supresses logging to the console
Requires the Cake.Http addin
|
ThrowIfNull |
T |
Throws a
System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
ThrowIfNull |
T |
Throws a
System.ArgumentNullException if the value is null, otherwise returns the value
From AssertExtensions
Requires the Cake.Incubator addin
|
ToDictionary |
IDictionary |
From ObjectHelpers
Requires the Cake.DeployParams addin
|
To |
string |
Returns the string value or a
Not set > markup suitable for Spectre.Console.
From StringExtensions
Requires the Cake.Issues addin
|
Use |
HttpSettings |
Adds a "Basic" Authorization Header to the request.
Requires the Cake.Http addin
|
Use |
HttpSettings |
Adds a "Bearer" Token Authorization Header to the request.
Used when authorization against a resource that uses OAUTH2
Requires the Cake.Http addin
|
Use |
HttpSettings |
Adds client certificate(s) to the http handler.
Requires the Cake.Http addin
|
Use |
HttpSettings |
Adds client certificate(s) to the http handler.
Requires the Cake.Http addin
|