|
Mila
Deep Neural Network Library
|
Performs one HTTP GET. More...
Public Member Functions | |
| virtual HttpResponse | fetch (const HttpFetch &request, const SinkCallback &sink, const HeadersCallback &on_headers) const =0 |
| virtual std::string | name () const =0 |
| Stable identifier, for messages. e.g. "libcurl". | |
Performs one HTTP GET.
Three obligations, and they are the whole contract:
Do not follow redirects. Report the status and the Location header; the client decides whether to follow and what may be sent to the next host.
Send exactly the headers given. No token discovery, no Range construction, no additions of any kind. A transport is never told a token – it is handed headers the client has already decided are safe for this exact host, which is what makes an untrusted implementation safe.
Do not deliver a non-2xx body to the sink. A redirect or error body must never reach a caller that is hashing bytes into a blob; capture a bounded prefix into message instead.
|
pure virtual |
Stable identifier, for messages. e.g. "libcurl".
Implemented in Mila::Distribution::CurlHttpTransport, and Mila::Distribution::NullHttpTransport.