daranzolin / rcanvas

R Client for Canvas LMS API
Other
90 stars 43 forks source link

Add generic (exported) function to execute requests #35

Closed vanatteveldt closed 5 years ago

vanatteveldt commented 5 years ago

Hey David,

Thanks again for making and updating the rcanvas package! :)

I thought it might be useful to add a generic (exported) function to execute requests to access endpoints that are not exposed by a specific function. For example, if there wouldn't be a get_announcements function the user could call:

do_query("announcements", list(`context_codes[]`="course_123"))

This is intended as a 'power user' function, but I don't think there's a risk in exporting it, but if it doesn't agree with your design ideas I completely understand.

(Note that this function could also be used internally by existing functions to remove the url building and result processing boilerplate)

daranzolin commented 5 years ago

This is truly a brilliant idea and one I wish I'd thought of earlier. Love it!