The restclient lib should communicate its needs to GET and POST with loose coupling.
This is because certain types of clients may need to handle their requests in a manner that cannot be accomplished with a single method call. E.g. a javascript wrapper should use the standard ajax methods, which are async and have their own callbacks.
I feel like this should be done with channels, for input and output. These receive and send simple data-only structs. E.g.
The restclient lib should communicate its needs to GET and POST with loose coupling.
This is because certain types of clients may need to handle their requests in a manner that cannot be accomplished with a single method call. E.g. a javascript wrapper should use the standard ajax methods, which are async and have their own callbacks.
I feel like this should be done with channels, for input and output. These receive and send simple data-only structs. E.g.
Output:
{ "method": "POST", "url": "blah", "content-type": "application/json", "data": "blahblahblah" }
Input:
{ "output": as per above, "error": null, "http-response": { "status": 200 } }