Promise: Replace Promise with Promise2, slightly updated interface.
Most notable differences between HTTP.Promise2 and HTTP.Promise:
- Less filling (20% smaller compiled object file).
- Instead of two result objects, we simply have a single
HTTP.Promise.Result object which is passed both on_success()
and on_failure(). Why does the original separate this in a
Promise.Success and Promise.Failure type?
- Various code optimisations, that do not change the interface.
- The Result object lacks the ok() method. What use was/is it?
You should normally already know if you are a success or a failure
- The Result object returns the raw body through "data", and the decoded
body through get() (to conform more to standard Future objects).
HTTP.Promise2: Offer get() instead of data in the Result object.
HTTP.Promise2: Proposed changes/optimisation/simplification of HTTP.Promise.