![]() |
OpenMS
|
Synchronous HTTP GET request using libcurl. More...
#include <OpenMS/SYSTEM/NetworkGetRequest.h>
Public Member Functions | |
| NetworkGetRequest () | |
| ~NetworkGetRequest () | |
| void | setUrl (const std::string &url) |
| set the URL to request | |
| void | setTimeout (int seconds) |
| set the timeout in seconds (0 = no timeout) | |
| void | run () |
| execute the GET request (blocks until complete or timeout) | |
| std::string | getResponse () const |
| returns the response as a string | |
| const std::vector< char > & | getResponseBinary () const |
| returns the raw response bytes | |
| bool | hasError () const |
| returns true if an error occurred during the query | |
| std::string | getErrorString () const |
| returns the error message | |
Private Member Functions | |
| NetworkGetRequest (const NetworkGetRequest &)=delete | |
| NetworkGetRequest & | operator= (const NetworkGetRequest &)=delete |
Private Attributes | |
| std::vector< char > | response_bytes_ |
| std::string | url_ |
| int | timeout_ = 0 |
| bool | has_error_ = false |
| std::string | error_string_ |
Synchronous HTTP GET request using libcurl.
| ~NetworkGetRequest | ( | ) |
|
privatedelete |
| std::string getErrorString | ( | ) | const |
returns the error message
| std::string getResponse | ( | ) | const |
returns the response as a string
| const std::vector< char > & getResponseBinary | ( | ) | const |
returns the raw response bytes
| bool hasError | ( | ) | const |
returns true if an error occurred during the query
|
privatedelete |
| void run | ( | ) |
execute the GET request (blocks until complete or timeout)
| void setTimeout | ( | int | seconds | ) |
set the timeout in seconds (0 = no timeout)
| void setUrl | ( | const std::string & | url | ) |
set the URL to request
|
private |
|
private |
|
private |
|
private |
|
private |