Show / Hide Table of Contents

    Class ContentHelper

    Some helpers for handling content.

    Inheritance
    System.Object
    ContentHelper
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: DocuWare.Services.Http.Client
    Assembly: DocuWare.RestClient.dll
    Syntax
    public static class ContentHelper

    Methods

    AddFileName(HttpContent, String, String)

    Adds the name of the file.

    Declaration
    public static HttpContent AddFileName(this HttpContent content, string name, string fileName)
    Parameters
    Type Name Description
    System.Net.Http.HttpContent content

    The content.

    System.String name

    The name.

    System.String fileName

    Name of the file.

    Returns
    Type Description
    System.Net.Http.HttpContent

    CreateContent(Byte[], String)

    Creates the content of the file.

    Declaration
    public static HttpContent CreateContent(byte[] data, string contentType)
    Parameters
    Type Name Description
    System.Byte[] data

    The body data.

    System.String contentType

    Type of the content.

    Returns
    Type Description
    System.Net.Http.HttpContent

    CreateContent(XNode, String)

    Creates the content.

    Declaration
    public static HttpContent CreateContent(XNode xmlNode, string requestContentType = "application/xml")
    Parameters
    Type Name Description
    System.Xml.Linq.XNode xmlNode

    The XML node.

    System.String requestContentType

    Type of the request content.

    Returns
    Type Description
    System.Net.Http.HttpContent

    CreateFileContent(IFileUploadInfo, String)

    Creates the content of the file.

    Declaration
    public static HttpContent CreateFileContent(IFileUploadInfo fileInfo, string contentType)
    Parameters
    Type Name Description
    IFileUploadInfo fileInfo

    The file info.

    System.String contentType

    Type of the content.

    Returns
    Type Description
    System.Net.Http.HttpContent

    CreateFileContent(Stream, String)

    Creates the content of the file.

    Declaration
    public static HttpContent CreateFileContent(Stream stream, string contentType)
    Parameters
    Type Name Description
    System.IO.Stream stream

    The stream.

    System.String contentType

    Type of the content.

    Returns
    Type Description
    System.Net.Http.HttpContent

    CreateXmlContent<T>(T, String)

    Creates the content of the XML.

    Declaration
    public static HttpContent CreateXmlContent<T>(T o, string contentType = "application/xml")
    
        where T : class
    Parameters
    Type Name Description
    T o

    The o.

    System.String contentType

    Type of the content.

    Returns
    Type Description
    System.Net.Http.HttpContent
    Type Parameters
    Name Description
    T
    About Us Contact Imprint Terms Data privacy
    © 2024 DocuWare Corporation powered by DocFX Back to top