Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
blocks:app-note:interacting-from-a-custom-web-page [2020-04-06 14:33]
admin An OBJECT is passed to subscribe
blocks:app-note:interacting-from-a-custom-web-page [2020-07-09 15:50] (current)
admin [Using HTTP requests]
Line 215: Line 215:
 Once these three steps are done, the promise is resolved with the name of the generated image file, now available under /public on the Blocks server. If any error occurs, the promise is instead rejected, passing an error code back as the HTTP POST request'​s result. Upon receiving the result, the custom web page's //main.js// script proceeds by displaying the resulting image. Note that the //fetch// function, called to make the HTTP request from the client side, also returns a //Promise// object, eventually resolved with the result of the operation once its //then// function is called. Once these three steps are done, the promise is resolved with the name of the generated image file, now available under /public on the Blocks server. If any error occurs, the promise is instead rejected, passing an error code back as the HTTP POST request'​s result. Upon receiving the result, the custom web page's //main.js// script proceeds by displaying the resulting image. Note that the //fetch// function, called to make the HTTP request from the client side, also returns a //Promise// object, eventually resolved with the result of the operation once its //then// function is called.
  
-[[blocks:​app-note:​start#​application_notes|Go back to the application notes overview.]]