Module Ethon::Easy::Header
In: lib/ethon/easy/header.rb

This module contains the logic around adding headers to libcurl.

@api private

Methods

Public Instance methods

Compose libcurl header string from key and value. Also replaces null bytes, because libcurl will complain otherwise.

@example Compose header.

  easy.compose_header('User-Agent', 'Ethon')

@param [ String ] key The header name. @param [ String ] value The header value.

@return [ String ] The composed header.

Return header_list.

@example Return header_list.

  easy.header_list

@return [ FFI::Pointer ] The header list.

Return headers, return empty hash if none.

@example Return the headers.

  easy.headers

@return [ Hash ] The headers.

Set the headers.

@example Set the headers.

  easy.headers = {'User-Agent' => 'ethon'}

@param [ Hash ] headers The headers.

[Validate]