Class Curl::PostField
In: ext/curb_postfield.c
Parent: Object
============= INIT LIB =====================

Methods

Public Class methods

Create a new Curl::PostField, supplying the field name, content, and, optionally, Content-type (curl will attempt to determine this if not specified).

The block form allows a block to supply the content for this field, called during the perform. The block should return a ruby string with the field data.

Create a new Curl::PostField for a file upload field, supplying the local filename to read from, and optionally the remote filename (defaults to the local name).

The block form allows a block to supply the content for this field, called during the perform. The block should return a ruby string with the field data.

Public Instance methods

Obtain the POST field content for this PostField.

Set the POST field content for this PostField. Ignored when a content_proc is supplied via either +Curl::PostField.file+ or set_content_proc.

Get the POST field Content-type for this PostField.

Set the POST field Content-type for this PostField.

Get the POST field local filename for this PostField (when performing a file upload).

Set the POST field local filename for this PostField (when performing a file upload). Ignored when a content_proc is supplied via either +Curl::PostField.file+ or set_content_proc.

Obtain the POST field name for this PostField.

Set the POST field name for this PostField.

Get the POST field remote filename for this PostField (when performing a file upload).

Set the POST field remote filename for this PostField (when performing a file upload). If no remote filename is provided, and no content_proc is supplied, the local filename is used. If no remote filename is specified when a content_proc is used, an exception will be raised during the perform.

Set a content proc for this field. This proc will be called during the perform to supply the content for this field, overriding any setting of content or local_file.

to_s()

Alias for to_str

Obtain a String representation of this PostField in url-encoded format. This is used to construct the post data for non-multipart POSTs.

Only content fields may be converted to strings.

[Validate]