Crashpad
Classes | Public Member Functions | List of all members
crashpad::HTTPMultipartBuilder Class Reference

This class is used to build a MIME multipart message, conforming to RFC 2046, for use as a HTTP request body. More...

#include "util/net/http_multipart_builder.h"

Public Member Functions

void SetFormData (const std::string &key, const std::string &value)
 Sets a Content-Disposition: form-data key-value pair. More...
 
void SetFileAttachment (const std::string &key, const std::string &upload_file_name, const base::FilePath &path, const std::string &content_type)
 Specifies the file at path to have its contents uploaded as multipart data, available at name of upload_file_name. More...
 
std::unique_ptr< HTTPBodyStreamGetBodyStream ()
 Generates the HTTPBodyStream for the data currently supplied to the builder. More...
 
HTTPHeaders::value_type GetContentType () const
 Gets the header pair for "Content-Type".
 

Detailed Description

This class is used to build a MIME multipart message, conforming to RFC 2046, for use as a HTTP request body.

Member Function Documentation

§ GetBodyStream()

std::unique_ptr< HTTPBodyStream > crashpad::HTTPMultipartBuilder::GetBodyStream ( )

Generates the HTTPBodyStream for the data currently supplied to the builder.

Returns
A caller-owned HTTPBodyStream object.

§ SetFileAttachment()

void crashpad::HTTPMultipartBuilder::SetFileAttachment ( const std::string &  key,
const std::string &  upload_file_name,
const base::FilePath &  path,
const std::string &  content_type 
)

Specifies the file at path to have its contents uploaded as multipart data, available at name of upload_file_name.

Parameters
[in]keyThe key of the form data, specified as the name in the multipart message. Any data previously set on this class with this key will be overwritten.
[in]upload_file_nameThe filename to specify for this multipart data attachment.
[in]pathThe path of the file whose contents will be uploaded.
[in]content_typeThe Content-Type to specify for the attachment. If this is empty, "application/octet-stream" will be used.

§ SetFormData()

void crashpad::HTTPMultipartBuilder::SetFormData ( const std::string &  key,
const std::string &  value 
)

Sets a Content-Disposition: form-data key-value pair.

Parameters
[in]keyThe key of the form data, specified as the name in the multipart message. Any data previously set on this class with this key will be overwritten.
[in]valueThe value to set at the key.

The documentation for this class was generated from the following files: