Class WebHttpRequestInterceptor

    Definition

    Namespace:
    Tizen.NUI
    Assembly:
    Tizen.NUI.dll

    It is a class for http request interceptor of web view.

    public class WebHttpRequestInterceptor : Disposable
    Inheritance
    object
    Disposable
    WebHttpRequestInterceptor

    Properties

    View Source

    Headers

    Gets headers of intercepted http request. Headers is a map with string key-value pairs, for example, "Accept: text/plain", "Accept-Charset: utf-8", etc.

    Declaration
    public IDictionary<string, string> Headers { get; }
    Property Value
    Type Description
    IDictionary<, ><string, string>
    View Source

    InterceptedWebView

    Gets webview in which request is intercepted.

    Declaration
    public WebView InterceptedWebView { get; }
    Property Value
    Type Description
    WebView
    View Source

    Method

    Gets method of intercepted http request, for example, GET, POST, etc.

    Declaration
    public string Method { get; }
    Property Value
    Type Description
    string
    View Source

    Url

    Gets url of intercepted request.

    Declaration
    public string Url { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    AddResponseHeader(string, string)

    Adds HTTP header to response for intercepted request. This function can be used inside or outside WebContext.HttpRequestIntercepted.

    Declaration
    public bool AddResponseHeader(string fieldName, string fieldValue)
    Parameters
    Type Name Description
    string fieldName

    Key of response header

    string fieldValue

    Value of response header

    Returns
    Type Description
    bool
    View Source

    AddResponseHeaders(IDictionary<string, string>)

    Adds HTTP headers to response for intercepted request. This function can be used inside or outside WebContext.HttpRequestIntercepted.

    Declaration
    public bool AddResponseHeaders(IDictionary<string, string> headers)
    Parameters
    Type Name Description
    IDictionary<, ><string, string> headers

    Map of response headers

    Returns
    Type Description
    bool
    View Source

    Ignore()

    Ignores the http request. When application doesn't have a response for intercepted request, this function would be called which notifies engine to proceed with normal resource loading. It can be called only INSIDE WebContext.HttpRequestIntercepted. After it called, any further call on WebHttpRequestInterceptor results in undefined behavior.

    Declaration
    public bool Ignore()
    Returns
    Type Description
    bool
    View Source

    ReleaseSwigCPtr(HandleRef)

    Declaration
    protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
    Parameters
    Type Name Description
    System.Runtime.InteropServices.HandleRef swigCPtr
    Overrides
    Disposable.ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef)
    View Source

    SetResponse(string, byte[])

    Writes whole response body with headers at once. To call it, application should have full response headers and body ready for the intercepted request. This function can be used inside or outside WebContext.HttpRequestIntercepted. After this call, any further call on WebHttpRequestInterceptor results in undefined behavior.

    Declaration
    public bool SetResponse(string headers, byte[] body)
    Parameters
    Type Name Description
    string headers

    Headers of response

    byte[] body

    Contents of response

    Returns
    Type Description
    bool
    View Source

    SetResponse(string, string)

    Writes whole response body with headers at once. To call it, application should have full response headers and body ready for the intercepted request. This function can be used inside or outside WebContext.HttpRequestIntercepted. After this call, any further call on WebHttpRequestInterceptor results in undefined behavior.

    Declaration
    public bool SetResponse(string headers, string body)
    Parameters
    Type Name Description
    string headers

    Headers of response

    string body

    Contents of response. For UTF-8 encoding, body would be got like System.Text.Encoding.UTF8.GetString(...)

    Returns
    Type Description
    bool
    View Source

    SetResponseBody(byte[])

    Writes whole response body at once. To call it, application should have full response body ready for the intercepted request. This function can be used inside or outside WebContext.HttpRequestIntercepted. After this call, any further call on WebHttpRequestInterceptor results in undefined behavior.

    Declaration
    public bool SetResponseBody(byte[] body)
    Parameters
    Type Name Description
    byte[] body

    Contents of response

    Returns
    Type Description
    bool
    View Source

    SetResponseBody(string)

    Writes whole response body at once. To call it, application should have full response body ready for the intercepted request. This function can be used inside or outside WebContext.HttpRequestIntercepted. After this call, any further call on WebHttpRequestInterceptor results in undefined behavior.

    Declaration
    public bool SetResponseBody(string body)
    Parameters
    Type Name Description
    string body

    Contents of response. For UTF-8 encoding, body would be got like System.Text.Encoding.UTF8.GetString(...)

    Returns
    Type Description
    bool
    View Source

    SetResponseStatus(int, string)

    Sets status code and status text of response for intercepted request. This function can be used inside or outside WebContext.HttpRequestIntercepted.

    Declaration
    public bool SetResponseStatus(int statusCode, string customStatusText)
    Parameters
    Type Name Description
    int statusCode

    Status code of response

    string customStatusText

    Status text of response

    Returns
    Type Description
    bool
    View Source

    WriteResponseChunk(byte[])

    Writes a part of response body. This function can be called only OUTSIDE WebContext.HttpRequestIntercepted. If it returns false, handling the request is done. Any further calls result in undefined behavior. User should always check return value, because response to this request might not be needed any more, and the function can return false even though user still has data to write.

    After writing full response body in chunks using this function, call it again with null as chunk, to signal that response body is finished.

    Declaration
    public bool WriteResponseChunk(byte[] chunk)
    Parameters
    Type Name Description
    byte[] chunk

    Chunk of response

    Returns
    Type Description
    bool
    View Source

    WriteResponseChunk(string)

    Writes a part of response body. This function can be called only OUTSIDE WebContext.HttpRequestIntercepted. If it returns false, handling the request is done. Any further calls result in undefined behavior. User should always check return value, because response to this request might not be needed any more, and the function can return false even though user still has data to write.

    After writing full response body in chunks using this function, call it again with null as chunk, to signal that response body is finished.

    Declaration
    public bool WriteResponseChunk(string chunk)
    Parameters
    Type Name Description
    string chunk

    Chunk of response. For UTF-8 encoding, chunk would be got like System.Text.Encoding.UTF8.GetString(...)

    Returns
    Type Description
    bool

    Extension Methods

    EXamlExtensions.LoadFromEXaml<T>(T, string)
    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    EXamlExtensions.LoadFromEXamlPath<TXaml>(TXaml, string)
    EXamlExtensions.LoadFromEXamlPath<T>(T, Type)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX