Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for async-rest? #3565

Open
ioquatix opened this issue Aug 6, 2019 · 5 comments
Open

Add support for async-rest? #3565

ioquatix opened this issue Aug 6, 2019 · 5 comments

Comments

@ioquatix
Copy link

ioquatix commented Aug 6, 2019

It's a RESTful client implementation that follows the REST thesis.

https://github.com/socketry/async-rest

Feel free to close this issue if irrelevant.

@wing328
Copy link
Member

wing328 commented Aug 6, 2019

@ioquatix thank for the suggestion. #3564 should make it easier to add another HTTP library support.

@wing328
Copy link
Member

wing328 commented Aug 8, 2019

#3564 has been merged into master.

Would you have time to contribute the enhancement (async-rest support)?

@wing328
Copy link
Member

wing328 commented Aug 13, 2019

Only 3 files need to be modified. I can get it started and you can fill in the blanks.

@ioquatix
Copy link
Author

I don't have time for this right now.

However, it seems like an interesting idea.

async-rest is pretty opinionated and while I think it's in a good space right now, I don't mind changing it as I understand the problem domain better. What I mean by that, is that it isn't a generic HTTP client, but it is modelled after the REST thesis.

What I find fascinating, is how bad - inconsistent - and messy - many web interfaces are. I've implemented two: cloudflare and async-slack recently.

Even thought they are both web interfaces, they are both very different.

For example, while cloudflare uses a non-200 status code for errors/failures, slack uses 200 OKAY with embedded JSON which contains the error message (if any).

Because of this, and other similar issues, it becomes very difficult to make async-rest as a consistent set of hooks for building out other interfaces. Which, because it's modelled after the REST thesis, is disappointing, because it means people are building decidedly orthogonal interfaces (e.g. not using HTTP status codes, using strange mechanisms for request/response).

Even some more crazy interfaces do things like HTTP www-encoded form parameter called json=$json_encoded_request_parameters, rather than just using the post body.

So....

Where am I going with this?

async-rest is kind of pure approach, based on the REST thesis. But many interfaces don't fit with that, because they are badly designed. So, the interesting thing here, is if we can model those interfaces automatically - and how does it look - because if you can figure that out, it would be amazing. Even to the point of identifying semantic conflicts between the defined interface, how it should be used, and how it fits with the REST thesis.

Surely you have some feedback about that.

@wing328
Copy link
Member

wing328 commented Aug 15, 2019

I don't have time for this right now.

That's ok. Let's see if anyone from the community has time to work on this enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants