Tizen Native API  7.0

It manages custom header.

Required Header

#include <http.h>

Overview

It manages custom header.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/network.internet
    It is recommended to design feature related codes in your application for reliability.
    You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
    To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
    More details on featuring your application can be found from Feature Element.

Functions

int http_transaction_header_add_field (http_transaction_h http_transaction, const char *field_name, const char *field_value)
 Adds a named field to header.
int http_transaction_header_remove_field (http_transaction_h http_transaction, const char *field_name)
 Removes the named field from header.
int http_transaction_header_get_field_value (http_transaction_h http_transaction, const char *field_name, char **field_value)
 Gets the HTTP Header Field value from custom header.

Function Documentation

int http_transaction_header_add_field ( http_transaction_h  http_transaction,
const char *  field_name,
const char *  field_value 
)

Adds a named field to header.

Adds a named field, which is a <fieldName, fieldValue> pair, to the current instance of HTTP Transaction.

Since :
3.0
Parameters:
[in]http_transactionThe HTTP transaction handle
[in]field_nameThe HTTP Header Field name
[in]field_valueThe HTTP Header Field value
Returns:
0 on success, otherwise negative error value
Return values:
HTTP_ERROR_NONESuccessful
HTTP_ERROR_INVALID_PARAMETERInvalid parameter
HTTP_ERROR_INVALID_OPERATIONInvalid operation
HTTP_ERROR_NOT_SUPPORTEDNot Supported
int http_transaction_header_get_field_value ( http_transaction_h  http_transaction,
const char *  field_name,
char **  field_value 
)

Gets the HTTP Header Field value from custom header.

Since :
3.0
Remarks:
The field_value should be freed using free().
Parameters:
[in]http_transactionThe HTTP transaction handle
[in]field_nameThe HTTP Header Field name
[out]field_valueThe HTTP Header Field value
Returns:
0 on success, otherwise negative error value
Return values:
HTTP_ERROR_NONESuccessful
HTTP_ERROR_INVALID_PARAMETERInvalid parameter
HTTP_ERROR_INVALID_OPERATIONInvalid operation
HTTP_ERROR_NOT_SUPPORTEDNot Supported
int http_transaction_header_remove_field ( http_transaction_h  http_transaction,
const char *  field_name 
)

Removes the named field from header.

Remove the named field, which is a <fieldName, fieldValue> pair, from the current instance of HTTP Transaction.

Since :
3.0
Parameters:
[in]http_transactionThe HTTP transaction handle
[in]field_nameThe HTTP Header Field name
Returns:
0 on success, otherwise negative error value
Return values:
HTTP_ERROR_NONESuccessful
HTTP_ERROR_INVALID_PARAMETERInvalid parameter
HTTP_ERROR_INVALID_OPERATIONInvalid operation
HTTP_ERROR_NOT_SUPPORTEDNot Supported