Show / Hide Table of Contents

    Class HttpResponseExtensions

    Extension methods for the Microsoft.AspNetCore.Http.HttpResponse class.

    Inheritance
    System.Object
    HttpResponseExtensions
    Namespace: Cuemon.AspNetCore.Http
    Assembly: Cuemon.AspNetCore.dll
    Syntax
    public static class HttpResponseExtensions

    Methods

    | Improve this Doc

    IsNotModifiedStatusCode(HttpResponse)

    Determines whether the HTTP response equals a 304 Not Modified.

    Declaration
    public static bool IsNotModifiedStatusCode(this HttpResponse response)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.HttpResponse response

    An instance of the Microsoft.AspNetCore.Http.HttpResponse object.

    Returns
    Type Description
    System.Boolean

    true if Microsoft.AspNetCore.Http.HttpResponse.StatusCode is NotModified (304); otherwise, false.

    | Improve this Doc

    IsSuccessStatusCode(HttpResponse)

    Determines whether the HTTP response was successful.

    Declaration
    public static bool IsSuccessStatusCode(this HttpResponse response)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.HttpResponse response

    An instance of the Microsoft.AspNetCore.Http.HttpResponse object.

    Returns
    Type Description
    System.Boolean

    true if Microsoft.AspNetCore.Http.HttpResponse.StatusCode was in the Successful range (200-299); otherwise, false.

    | Improve this Doc

    SetEntityTagHeaderInformation(HttpResponse, HttpRequest, ChecksumBuilder, Boolean)

    This method will either add or update the necessary HTTP response headers needed to provide entity tag header information.

    Declaration
    public static void SetEntityTagHeaderInformation(this HttpResponse response, HttpRequest request, ChecksumBuilder builder, bool isWeak = false)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.HttpResponse response

    The Microsoft.AspNetCore.Http.HttpResponse to extend.

    Microsoft.AspNetCore.Http.HttpRequest request

    An instance of the Microsoft.AspNetCore.Http.HttpRequest object.

    ChecksumBuilder builder

    A ChecksumBuilder that represents the integrity of the client.

    System.Boolean isWeak

    A value that indicates if this entity-tag header is a weak validator.

    | Improve this Doc

    SetLastModifiedHeaderInformation(HttpResponse, HttpRequest, DateTime)

    This method will either add or update the necessary HTTP response headers needed to provide last-modified information.

    Declaration
    public static void SetLastModifiedHeaderInformation(this HttpResponse response, HttpRequest request, DateTime lastModified)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.HttpResponse response

    The Microsoft.AspNetCore.Http.HttpResponse to extend.

    Microsoft.AspNetCore.Http.HttpRequest request

    An instance of the Microsoft.AspNetCore.Http.HttpRequest object.

    System.DateTime lastModified

    A value that represents when the resource was either created or last modified.

    | Improve this Doc

    WriteBodyAsync(HttpResponse, Func<Byte[]>)

    Asynchronously writes a sequence of bytes to the response body stream and advances the current position within this stream by the number of bytes written.

    Declaration
    public static Task WriteBodyAsync(this HttpResponse response, Func<byte[]> body)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.HttpResponse response

    The Microsoft.AspNetCore.Http.HttpResponse to extend.

    System.Func<System.Byte[]> body

    The function delegate that resolves the bytes to write.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A task that represents the asynchronous write operation.

    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX