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

PUT, POST etc don't really take array parameters #5

Open
mylescarrick opened this issue Mar 26, 2014 · 0 comments
Open

PUT, POST etc don't really take array parameters #5

mylescarrick opened this issue Mar 26, 2014 · 0 comments

Comments

@mylescarrick
Copy link
Contributor

I'm trying to call the update courses API
https://canvas.instructure.com/doc/api/courses.html#method.courses.batch_update

It needs a courses_id param... but because the clean_params doesn't yet handle array values (see note at https://github.com/whitmer/canvas-api/blob/master/lib/canvas-api.rb#L177) I'm trying to do what the docs suggest, and send an array of arrays...

... but put, post, delete methods assume a hash (https://github.com/whitmer/canvas-api/blob/master/lib/canvas-api.rb#L150) - so they pass a string/symbol key... so they fail (of course) with:
TypeError: no implicit conversion of String into Integer

I might take a look at the clean_params implementation - or in the meantime it might be worth updating the docs, as the examples there won't work.

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

No branches or pull requests

1 participant