Method

FoundryJsonOutputStreamwrite

Declaration [src]

DexFuture*
foundry_json_output_stream_write (
  FoundryJsonOutputStream* self,
  GHashTable* headers,
  JsonNode* node,
  GBytes* delimiter
)

Description [src]

The caller must not mutate node after calling this function until after the operation has completed.

If headers is non-null, then they will be added to the stream at the start in HTTP style. The Content-Length will automatically be added followed by \r\n\r\n.

If you only want Content-Length provided, then it is okay to pass an empty GHashTable.

If headers is null, then no headers will be written.

Parameters

headers

Type: GHashTable

A hashtable of headers to write to the stream.

The argument can be NULL.
The data is owned by the caller of the method.
node

Type: JsonNode

The JSON node to be written.

The data is owned by the caller of the method.
delimiter

Type: GBytes

The delimiter to use as the message suffix.

The data is owned by the caller of the method.

Return value

Type: DexFuture

A DexFuture that resolves to any value or rejects with error.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.