HttpTransformer.TransformResponseAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
TransformResponseAsync(HttpContext, HttpResponseMessage) |
Obsolete.
A callback that is invoked when the proxied response is received. The status code and reason phrase will be copied
to the HttpContext.Response before the callback is invoked, but may still be modified there. The headers will be
copied to HttpContext.Response.Headers by the base implementation, excludes certain protocol headers like
|
TransformResponseAsync(HttpContext, HttpResponseMessage, CancellationToken) |
A callback that is invoked when the proxied response is received. The status code and reason phrase will be copied
to the HttpContext.Response before the callback is invoked, but may still be modified there. The headers will be
copied to HttpContext.Response.Headers by the base implementation, excludes certain protocol headers like
|
TransformResponseAsync(HttpContext, HttpResponseMessage)
- Source:
- HttpTransformer.cs
- Source:
- HttpTransformer.cs
Caution
This overload of TransformResponseAsync is obsolete. Override and use the overload accepting a CancellationToken instead.
A callback that is invoked when the proxied response is received. The status code and reason phrase will be copied
to the HttpContext.Response before the callback is invoked, but may still be modified there. The headers will be
copied to HttpContext.Response.Headers by the base implementation, excludes certain protocol headers like
Transfer-Encoding: chunked
.
public virtual System.Threading.Tasks.ValueTask<bool> TransformResponseAsync (Microsoft.AspNetCore.Http.HttpContext httpContext, System.Net.Http.HttpResponseMessage? proxyResponse);
[System.Obsolete("This overload of TransformResponseAsync is obsolete. Override and use the overload accepting a CancellationToken instead.")]
public virtual System.Threading.Tasks.ValueTask<bool> TransformResponseAsync (Microsoft.AspNetCore.Http.HttpContext httpContext, System.Net.Http.HttpResponseMessage? proxyResponse);
abstract member TransformResponseAsync : Microsoft.AspNetCore.Http.HttpContext * System.Net.Http.HttpResponseMessage -> System.Threading.Tasks.ValueTask<bool>
override this.TransformResponseAsync : Microsoft.AspNetCore.Http.HttpContext * System.Net.Http.HttpResponseMessage -> System.Threading.Tasks.ValueTask<bool>
[<System.Obsolete("This overload of TransformResponseAsync is obsolete. Override and use the overload accepting a CancellationToken instead.")>]
abstract member TransformResponseAsync : Microsoft.AspNetCore.Http.HttpContext * System.Net.Http.HttpResponseMessage -> System.Threading.Tasks.ValueTask<bool>
override this.TransformResponseAsync : Microsoft.AspNetCore.Http.HttpContext * System.Net.Http.HttpResponseMessage -> System.Threading.Tasks.ValueTask<bool>
Public Overridable Function TransformResponseAsync (httpContext As HttpContext, proxyResponse As HttpResponseMessage) As ValueTask(Of Boolean)
Parameters
- httpContext
- HttpContext
The incoming request.
- proxyResponse
- HttpResponseMessage
The response from the destination. This can be null if the destination did not respond.
Returns
A bool indicating if the response should be proxied to the client or not. A derived implementation that returns false may send an alternate response inline or return control to the caller for it to retry, respond, etc.
- Attributes
Applies to
TransformResponseAsync(HttpContext, HttpResponseMessage, CancellationToken)
- Source:
- HttpTransformer.cs
- Source:
- HttpTransformer.cs
A callback that is invoked when the proxied response is received. The status code and reason phrase will be copied
to the HttpContext.Response before the callback is invoked, but may still be modified there. The headers will be
copied to HttpContext.Response.Headers by the base implementation, excludes certain protocol headers like
Transfer-Encoding: chunked
.
public virtual System.Threading.Tasks.ValueTask<bool> TransformResponseAsync (Microsoft.AspNetCore.Http.HttpContext httpContext, System.Net.Http.HttpResponseMessage? proxyResponse, System.Threading.CancellationToken cancellationToken);
abstract member TransformResponseAsync : Microsoft.AspNetCore.Http.HttpContext * System.Net.Http.HttpResponseMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
override this.TransformResponseAsync : Microsoft.AspNetCore.Http.HttpContext * System.Net.Http.HttpResponseMessage * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
Public Overridable Function TransformResponseAsync (httpContext As HttpContext, proxyResponse As HttpResponseMessage, cancellationToken As CancellationToken) As ValueTask(Of Boolean)
Parameters
- httpContext
- HttpContext
The incoming request.
- proxyResponse
- HttpResponseMessage
The response from the destination. This can be null if the destination did not respond.
- cancellationToken
- CancellationToken
Indicates that the request is being canceled.
Returns
A bool indicating if the response should be proxied to the client or not. A derived implementation that returns false may send an alternate response inline or return control to the caller for it to retry, respond, etc.