atomicjolt / lms_api

Ruby wrapper for the Canvas API
MIT License
6 stars 2 forks source link

204 response code on DELETE requests? #10

Closed jhugon61 closed 6 years ago

jhugon61 commented 6 years ago

Thanks for this very useful library.

I am running into an issue when generating a "DELETE_QUIZ_QUESTION" request. According to the documentation (https://canvas.instructure.com/doc/api/quiz_questions.html#method.quizzes/quiz_questions.destroy) and the live API, the response code returned on successful deletion will be 204.

The request I generate appears to be valid (the question does get deleted from the quiz on Canvas), but the gem raises an LMS::Canvas::InvalidAPIRequestException. Looking at the /lib/lms/canvas.rb file, the check_result method on line 188 appears to consider only 200 and 201 as valid response codes. Should 204 also be considered valid, at least in conjunction with DELETE verbs?

Let me know if I can provide additional information/traces as need be.

jbasdf commented 6 years ago

Thanks for finding that. A 204 is valid. We'll get it fixed.

jbasdf commented 6 years ago

Fixed in version v1.3.10

jhugon61 commented 6 years ago

Thanks very much for the prompt response! All the best,

Jacques Hugon
jacques.hugon@gmail.com

On Dec 9, 2017, at 3:13 PM, Justin Ball notifications@github.com wrote:

Thanks for finding that. A 204 is valid. We'll get it fixed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/atomicjolt/lms_api/issues/10#issuecomment-350471265, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNtJSkJyc_QWfdLnSEg5r4QIamjAvaVks5s-pV2gaJpZM4Q5pbm.