9 #ifndef MRPT_NET_UTILS_H 10 #define MRPT_NET_UTILS_H 59 const string &auth_user =
string(),
60 const string &auth_pass =
string(),
61 int *out_http_responsecode = NULL,
87 const string &auth_user =
string(),
88 const string &auth_pass =
string(),
89 int *out_http_responsecode = NULL,
98 const string & http_method,
99 const string & http_send_content,
102 string &out_errormsg,
104 const string &auth_user =
string(),
105 const string &auth_pass =
string(),
106 int *out_http_responsecode = NULL,
109 int timeout_ms = 1000
123 const unsigned int timeout_ms = 3000
145 const int& max_attempts,
ERRORCODE_HTTP
Possible returns from a HTTP request.
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
std::vector< uint8_t > vector_byte
ERRORCODE_HTTP BASE_IMPEXP http_get(const string &url, vector_byte &out_content, string &out_errormsg, int port=80, const string &auth_user=string(), const string &auth_pass=string(), int *out_http_responsecode=NULL, mrpt::utils::TParameters< string > *extra_headers=NULL, mrpt::utils::TParameters< string > *out_headers=NULL, int timeout_ms=1000)
Perform an HTTP GET operation (version for retrieving the data as a vector_byte)
std::string BASE_IMPEXP getLastSocketErrorStr()
Returns a description of the last Sockets error.
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
bool BASE_IMPEXP Ping(const std::string &address, const int &max_attempts, std::string *output_str=NULL)
Ping an IP address.
bool BASE_IMPEXP DNS_resolve_async(const std::string &server_name, std::string &out_ip, const unsigned int timeout_ms=3000)
Resolve a server address by its name, returning its IP address as a string - This method has a timeou...
ERRORCODE_HTTP BASE_IMPEXP http_request(const string &http_method, const string &http_send_content, const string &url, vector_byte &out_content, string &out_errormsg, int port=80, const string &auth_user=string(), const string &auth_pass=string(), int *out_http_responsecode=NULL, mrpt::utils::TParameters< string > *extra_headers=NULL, mrpt::utils::TParameters< string > *out_headers=NULL, int timeout_ms=1000)
Generic function for HTTP GET & POST methods.