Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Distribution::IHttpTransport Class Referenceabstractexport

Performs one HTTP GET. More...

Inheritance diagram for Mila::Distribution::IHttpTransport:
Mila::Distribution::CurlHttpTransport Mila::Distribution::NullHttpTransport

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".

Detailed Description

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.

Member Function Documentation

◆ name()

virtual std::string Mila::Distribution::IHttpTransport::name ( ) const
pure virtual

Stable identifier, for messages. e.g. "libcurl".

Implemented in Mila::Distribution::CurlHttpTransport, and Mila::Distribution::NullHttpTransport.


The documentation for this class was generated from the following file: