egg-mode-rs / egg-mode

a twitter api crate for rust
https://crates.io/crates/egg-mode
Mozilla Public License 2.0
372 stars 65 forks source link

expose a generic raw request builder #94

Closed QuietMisdreavus closed 4 years ago

QuietMisdreavus commented 4 years ago

Closes #32

This PR is the culmination of the work from #91 and #93. When i started egg-mode, i swore up and down that i didn't want to expose a generic OAuth mechanism, but while i was working on the raw module and the auth refactor, i noticed i could create something that was both easy-to-use and useful to the people who needed to use egg-mode for purposes we hadn't allowed or envisioned. I don't really want to extract this into its own crate unless people really want it for something other than Twitter, since i don't want to create the extra dependency for seemingly no reason.

As with everything i add to egg-mode, i tried to write compelling documentation to describe how to use it effectively. Part of the design of RequestBuilder was informed by my existing use of the auth internals, as well as looking at endpoints i hadn't bound yet or couldn't access, like PUT direct_messages/welcome_messages/update or the Enterprise APIs requiring Basic Authentication.

Like with my last couple PRs, i'm going to leave this up for a day or so, then revisit it for any final tweaks before merging. I'll probably want to cut a release after this lands, to make it available for people to use more easily.