BinaryNinja::Http::Response Struct Reference

Basic HTTP response structure. More...

Detailed Description

Basic HTTP response structure.

Public Member Functions

std::vector< uint8_t > GetRaw () const noexcept
 Get response body as uint8_t vector. More...
 
std::string GetString () const noexcept
 Get response body as text string. More...
 
Json::Value GetJson () const
 Get response body as a json value. More...
 
bool GetJson (Json::Value &value) const noexcept
 Get response body as a json value without throwing. More...
 

Public Attributes

DownloadInstance::Response response
 
std::vector< uint8_t > body
 
std::string error
 

Member Function Documentation

◆ GetRaw()

vector< uint8_t > BinaryNinja::Http::Response::GetRaw ( ) const
noexcept

Get response body as uint8_t vector.

Returns
Response body bytes

◆ GetString()

string BinaryNinja::Http::Response::GetString ( ) const
noexcept

Get response body as text string.

Returns
Response body string

◆ GetJson() [1/2]

Json::Value BinaryNinja::Http::Response::GetJson ( ) const

Get response body as a json value.

Returns
Response body json
Exceptions
runtime_errorOn JSON parse error

◆ GetJson() [2/2]

bool BinaryNinja::Http::Response::GetJson ( Json::Value &  value) const
noexcept

Get response body as a json value without throwing.

Parameters
valueOutput json value
Returns
True if successful

Member Data Documentation

◆ response

DownloadInstance::Response BinaryNinja::Http::Response::response

◆ body

std::vector<uint8_t> BinaryNinja::Http::Response::body

◆ error

std::string BinaryNinja::Http::Response::error