cmd-johnson / deno-oauth2-client

Minimalistic OAuth 2.0 client for Deno.
MIT License
45 stars 9 forks source link

Deno.HttpClient #14

Closed suchislife801 closed 1 year ago

suchislife801 commented 3 years ago

Hello. I just wanted to post an update regarding the Deno.HttpClient. Is it possible you can use this instead of OAK?

It would be nice to have a 100% deno solution.

cmd-johnson commented 3 years ago

Hi there! Apart from the *_test.ts files, this module does not directly depend any other modules, not even ones from the std library. I'm using fetch for all outgoing HTTP requests.

This module leaves handling requests originating from the user up to the developer, and while the example in the README shows how this can be done using oak, the same thing can easily be achieved with Deno's std HTTP Server. I've got an example for that here.

Also Deno.HttpClient appears to work in conjunction with fetch, i.e. is intended for outgoing requests. If customizing the fetch behavior is what you want, I might consider adding an option to override the usage of the inbuild fetch function with a custom implementation.

suchislife801 commented 3 years ago

I get you. Thank you for the quick reply.

Perhaps then, what I should have asked is, can you provide an example on the README that does not use Oak but rather, async await fetch?

I'm first trying to understand the pure Javascript OAUTH workflow and so far your library is the most intuitive I have found. I have looked at many.

thgh commented 3 years ago

@webdev3301 you may be looking for this http example