RestAliases.

Rest(ICakeContext, string, Uri, IDictionary<string, string>, BodyType, string, Action<Stream, IHttpResponse>) Method

Summary

Sends a REST request and receives its response.
Assembly
Cake.Rest.dll
Namespace
Cake.Rest
Containing Type
RestAliases

Syntax

public static IRestResponse Rest(this ICakeContext context, string method, Uri endpoint, IDictionary<string, string> headers, BodyType bodyType, string body, Action<Stream, IHttpResponse> advancedResponseWriter)

Attributes

Type Description
CakeMethodAliasAttribute
CakeNamespaceImportAttribute
CakeNamespaceImportAttribute
CakeNamespaceImportAttribute

Parameters

Name Type Description
context ICakeContext Cake build context
method string HTTP method
endpoint Uri Endpoint local address, starting with /
headers IDictionary<string, string> HTTP headers, null for no headers
bodyType BodyType Content type of request body
body string Contents of request body
advancedResponseWriter Action<Stream, IHttpResponse> Lambda function for reading response and writing to desired place.

Return Value

Type Description
IRestResponse REST response