Function mrpt::comms::net::http_get(const string&, std::vector<uint8_t>&, const HttpRequestOptions&, mrpt::optional_ref<HttpRequestOutput>)

Function Documentation

http_errorcode mrpt::comms::net::http_get(const string &url, std::vector<uint8_t> &out_content, const HttpRequestOptions &options = HttpRequestOptions(), mrpt::optional_ref<HttpRequestOutput> output = std::nullopt)

Perform an HTTP GET operation (version for retrieving the data as a std::vector<uint8_t>)

See also

http_request()

Parameters:
  • url – Must be a simple string of the form “http://<servername>/<relative-address>”.

  • port – The server port, if different from 80.

  • extra_headers – If provided, the given extra HTTP headers will be sent.

  • errormsg – On exit will contain a description of the error or “Ok”.

  • out_content – The buffer with the retrieved data.

  • out_http_responsecode – If provided, will hold the HTTP code, eg: 200, 404…

  • out_headers – If provided, a copy of all the headers returned by the server will be saved here.

  • auth_user

  • auth_pass – Send a basic HTTP authorization request with the given user & password.

Returns:

The error or success code.