Drop the following in your .nxxm/deps
:
The library is really lightweight, therefore it makes sense to include all definitions at once.
All documentation in this library suppose the use at function scope of :
In a RESTful model the CRUD operations are the entrypoints of Requests, and so is the entrypoint of xxhr :
From there on, all goes asynchronous with the on_response continuation handler which expects a lambda or whatever Callable which accepts a Response.
To get started, nothing better than downloading the everlasting HTTP Request For Comment :
HTTP is the icing on the cake of network communications, there are alot of OSI layer below, that we shouldn't care of but which might prevent your app from running correctly.
Therefore you can check an xxhr::Response for the resp.error
field :
To avoid blocking your application with never ending HTTP requests you can specify an xxhr::Timeout, which will calls the on_response callback early with the xxhr::Error code : ErrorCode::TIMEDOUT
.
For more details see Retry on failure