Class HttpTransportExtensions
The http transport extensions.
Inheritance
Inherited Members
Namespace: Microsoft.Bot.Builder.Enterprise.Transport
Assembly: Microsoft.Bot.Builder.Enterprise.dll
Syntax
public static class HttpTransportExtensions
Methods
View SourceCreateResponse(IPlatformRequest, Exception, String)
Creates the platform response from the request and the specified exception.
Declaration
public static IPlatformResponse CreateResponse(this IPlatformRequest request, Exception exception, string message = null)
Parameters
Type | Name | Description |
---|---|---|
IPlatformRequest | request | The request. |
System.Exception | exception | The exception. |
System.String | message | The message. |
Returns
Type | Description |
---|---|
IPlatformResponse | The IPlatformResponse. |
GetHttpRequest(IPlatformRequest)
The get http request.
Declaration
public static HttpRequestMessage GetHttpRequest(this IPlatformRequest request)
Parameters
Type | Name | Description |
---|---|---|
IPlatformRequest | request | The request. |
Returns
Type | Description |
---|---|
System.Net.Http.HttpRequestMessage | The System.Net.Http.HttpRequestMessage. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When the argument request or the request URI are null. |
System.InvalidOperationException | When the request type is not supported for this operation. |
GetHttpResponse(IPlatformResponse)
The get http response.
Declaration
public static HttpResponseMessage GetHttpResponse(this IPlatformResponse platformResponse)
Parameters
Type | Name | Description |
---|---|---|
IPlatformResponse | platformResponse | The platform response. |
Returns
Type | Description |
---|---|
System.Net.Http.HttpResponseMessage | The System.Net.Http.HttpResponseMessage. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | When the platformResponse type is of an unsupported type. |
GetPlatformRequest(HttpRequestMessage)
The get platform request from the http request.
Declaration
public static Task<IPlatformRequest> GetPlatformRequest(this HttpRequestMessage request)
Parameters
Type | Name | Description |
---|---|---|
System.Net.Http.HttpRequestMessage | request | The http request. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPlatformRequest> | The IPlatformRequest. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When the arguments to this method are null. |
GetPlatformResponse(HttpResponseMessage)
The get platform response.
Declaration
public static Task<IPlatformResponse> GetPlatformResponse(this HttpResponseMessage response)
Parameters
Type | Name | Description |
---|---|---|
System.Net.Http.HttpResponseMessage | response | The response. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<IPlatformResponse> | The IPlatformResponse. |
Exceptions
Type | Condition |
---|---|
PlatformUnauthorizedException | When the response status is Unauthorized of Forbidden. |
System.Web.Http.HttpResponseException | For any http failures except BadRequest, NotFound, and Unauthorized |