Gjsify LogoGjsify Logo

Hierarchy

  • Param

Index

Constructors

Properties

name: string

Methods

  • get_content(): object
  • Get the content of param. The content should be treated as read-only and not modified in any way.

    Returns object

  • get_content_length(): number
  • get_content_type(): string
  • Get the MIME type of the parameter. For example, basic strings have the MIME type "text/plain".

    Returns string

  • get_file_name(): string
  • get_name(): string
  • is_string(): boolean
  • unref(): void
  • new_full(name: string, use: Rest.MemoryUse, data: Uint8Array, content_type: string, filename: string): Rest.Param
  • Create a new #RestParam called name with length bytes of data as the value. content_type is the type of the data as a MIME type, for example "text/plain" for simple string parameters.

    If the parameter is a file upload it can be passed as filename.

    Parameters

    • name: string

      the parameter name

    • use: Rest.MemoryUse

      the #RestMemoryUse describing how the memory can be used

    • data: Uint8Array

      a pointer to the start of the data

    • content_type: string

      the content type of the data

    • filename: string

      the original filename, or %NULL

    Returns Rest.Param

  • A convience constructor to create a #RestParam from a given UTF-8 string. The resulting #RestParam will have a content type of "text/plain".

    Parameters

    • name: string

      the parameter name

    • use: Rest.MemoryUse

      the #RestMemoryUse describing how the memory can be used

    • string: string

      the parameter value

    Returns Rest.Param

  • new_with_owner(name: string, data: Uint8Array, content_type: string, filename: string, owner: object, owner_dnotify: GLib.DestroyNotify): Rest.Param
  • Create a new #RestParam called name with length bytes of data as the value. content_type is the type of the data as a MIME type, for example "text/plain" for simple string parameters.

    If the parameter is a file upload it can be passed as filename.

    When the #RestParam is freed, it will call owner_dnotify, passing owner to it. This allows you to do something like this:

    |[ GMappedFile *map = g_mapped_file_new (filename, FALSE, &error); RestParam *param = rest_param_new_with_owner ("media", g_mapped_file_get_contents (map), g_mapped_file_get_length (map), "image/jpeg", filename, map, (GDestroyNotify)g_mapped_file_unref);


    @constructor
    @param name the parameter name
    @param data a pointer to the start of the data
    @param content_type the content type of the data
    @param filename the original filename, or %NULL
    @param owner pointer to an object that owns `data`
    @param owner_dnotify a function to free/unref `owner` when the buffer is freed

    Parameters

    • name: string
    • data: Uint8Array
    • content_type: string
    • filename: string
    • owner: object
    • owner_dnotify: GLib.DestroyNotify

    Returns Rest.Param

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method