You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client should not raise an exception when an endpoint that is supposed to respond with a 204 responds with a 204.
Actual behavior
The client raises a NoMethodError because it tries to call #empty? on the HTTParty::Response object's body, which is nil.
I believe this is happening because HTTParty doesn't parse the response body for 204s and just supplies nil instead. This really old issue on the HTTParty repo seems like it could be related.
Steps to reproduce the problem
The screenshot above says it all, but ...
Create a price rule and/or discount code, note the IDs.
Attempt to delete the discount code or price rule using the REST client.
If the request is successful and responds with a 204, the client will raise a NoMethodError exception
I'm guessing this will happen with any 204 response from the REST API.
The text was updated successfully, but these errors were encountered:
Issue summary
When using the REST client to perform an action that returns an HTTP 204 response, such as deleting a discount code or deleting a price rule, the client raises a
NoMethodError
.shopify_api
version: 12.4.0Expected behavior
The client should not raise an exception when an endpoint that is supposed to respond with a 204 responds with a 204.
Actual behavior
The client raises a
NoMethodError
because it tries to call#empty?
on theHTTParty::Response
object's body, which isnil
.I believe this is happening because HTTParty doesn't parse the response body for 204s and just supplies
nil
instead. This really old issue on the HTTParty repo seems like it could be related.Steps to reproduce the problem
The screenshot above says it all, but ...
NoMethodError
exceptionI'm guessing this will happen with any 204 response from the REST API.
The text was updated successfully, but these errors were encountered: