# Module cloudi_request_info

- Description
- Data Types
- Function Index
- Function Details

### CloudI RequestInfo Creation and Parsing

RequestInfo is used for request meta-data which is normally key/value pairs that describe the context of the service request (e.g., HTTP header names and values for a HTTP request). The encoding provided below is a basic format for textual key/value data (i.e., neither the key or value should contain a null character, '\0') which is easily parsed in any programming language and is referred to as the 'text_pairs' format. It is valid to have multiple entries for the same key within the RequestInfo data. A key must be of size 1 or greater (`<<>>` will never exist as a key in text_pairs data).

.

Copyright © 2014-2015 Michael Truog

Version: 1.5.1 Mar 28 2017 19:21:39 ------------------------------------------------------------------------

Authors: Michael Truog (`mjtruog [at] gmail (dot) com`).

## Description

### CloudI RequestInfo Creation and Parsing

RequestInfo is used for request meta-data which is normally key/value pairs that describe the context of the service request (e.g., HTTP header names and values for a HTTP request). The encoding provided below is a basic format for textual key/value data (i.e., neither the key or value should contain a null character, '\0') which is easily parsed in any programming language and is referred to as the 'text_pairs' format. It is valid to have multiple entries for the same key within the RequestInfo data. A key must be of size 1 or greater (`<<>>` will never exist as a key in text_pairs data).

The ResponseInfo data is normally service request response meta-data (providing the response equivalent of RequestInfo for a request) and can utilize the same functions below.

These module functions provide Erlang serialization of the 'text_pairs' format for use with the cloudi_key_value module.

## Data Types

### dict_proxy()

`dict_proxy(Key, Value) = dict:dict(Key, Value)`

## Function Index

key_value_append/2 | #### Append RequestInfo key/value data. Use the same binary format.
key_value_new/1 | #### New RequestInfo key/value data. RequestInfo is meant to contain key/value pairs that is request meta-data.
key_value_parse/1 | #### Parse RequestInfo key/value data. RequestInfo is meant to contain key/value pairs that is request meta-data.

## Function Details

### key_value_append/2

`key_value_append(RequestInfo::cloudi_key_value:key_values(), Existing::binary()) -> Result::binary()`

#### Append RequestInfo key/value data.

Use the same binary format.

### key_value_new/1

`key_value_new(RequestInfo::cloudi_key_value:key_values()) -> Result::binary()`

#### New RequestInfo key/value data.

RequestInfo is meant to contain key/value pairs that is request meta-data. Create the binary RequestInfo data with a list of pairs or a dict data structure.

### key_value_parse/1

`key_value_parse(RequestInfo::binary() | cloudi_key_value:key_values()) -> Result::dict_proxy(cloudi_key_value:key(), cloudi_key_value:value())`

#### Parse RequestInfo key/value data.

RequestInfo is meant to contain key/value pairs that is request meta-data.

Generated by EDoc, Mar 28 2017, 19:21:39.