Skip to content

Put Method ​

Definition ​

  • Namespace: JASE.Network
  • Assembly: JASE.Network.dll

Overloads ​

NameDescription
Task<HttpTransaction> Put(string url, FormContentType contentType = null, string userAgent = null, IReadOnlyDictionary<string, string> headers = null, FormDataCollection payload = null, ClientCredential credentials = null, CookieCollection cookies = null, Encoding encoding = null, CancellationToken cancellationToken = null)Sends an HTTP PUT request to the specified URL.
Task<HttpTransaction> Put(string url, string contentType = null, string userAgent = null, IReadOnlyDictionary<string, string> headers = null, string payload = null, ClientCredential credentials = null, CookieCollection cookies = null, Encoding encoding = null, CancellationToken cancellationToken = null)Sends a PUT request to the specified URL with the given payload and headers using the specified content type.

Task<HttpTransaction> Put(string url, FormContentType contentType = null, string userAgent = null, IReadOnlyDictionary<string, string> headers = null, FormDataCollection payload = null, ClientCredential credentials = null, CookieCollection cookies = null, Encoding encoding = null, CancellationToken cancellationToken = null) ​

csharp
Task<HttpTransaction> Put(string url, FormContentType contentType = null, string userAgent = null, IReadOnlyDictionary<string, string> headers = null, FormDataCollection payload = null, ClientCredential credentials = null, CookieCollection cookies = null, Encoding encoding = null, CancellationToken cancellationToken = null)

Sends an HTTP PUT request to the specified URL.

Parameters ​

NameDescription
cancellationTokenCancellationToken
contentTypeThe content type of the payload. Defaults to UrlEncoded.
cookiesThe cookies to include in the request.
credentialsThe authentication credentials to use for the request.
encodingThe character encoding to use for the request. Defaults to UTF-8.
headersAdditional headers to include in the request.
payloadThe data to include in the request body.
urlThe URL to send the request to.
userAgentThe user agent to include in the request header. Defaults to "JASE.Core.Web".

Returns ​

A WebClient object representing the HTTP response.

Task<HttpTransaction> Put(string url, string contentType = null, string userAgent = null, IReadOnlyDictionary<string, string> headers = null, string payload = null, ClientCredential credentials = null, CookieCollection cookies = null, Encoding encoding = null, CancellationToken cancellationToken = null) ​

csharp
Task<HttpTransaction> Put(string url, string contentType = null, string userAgent = null, IReadOnlyDictionary<string, string> headers = null, string payload = null, ClientCredential credentials = null, CookieCollection cookies = null, Encoding encoding = null, CancellationToken cancellationToken = null)

Sends a PUT request to the specified URL with the given payload and headers using the specified content type.

Parameters ​

NameDescription
cancellationTokenCancellationToken
contentTypeThe content type of the payload. Default is "application/x-www-form-urlencoded".
cookiesThe cookies to include in the request.
credentialsThe authentication credentials to use for the request.
encodingThe encoding to use for the payload. Default is UTF-8.
headersThe additional headers to include in the request.
payloadThe payload to include in the request.
urlThe URL to which the PUT request is sent.
userAgentThe user agent string to use in the request header. Default is "JASE.Core.Web".

Returns ​

A WebClient object representing the response to the PUT request.