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

Add params-in-body support to DELETE #138

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mfinkle
Copy link

@mfinkle mfinkle commented Oct 29, 2019

Tumblr has a few API routes that use DELETE but require the params be placed in the request body, not on the URL

Tumblr has a few API routes that use DELETE but require the params be placed in the request body, not on the URL
@@ -548,7 +548,7 @@ def _send_post(self, blogname, params):

return self.send_api_request("post", url, params, valid_options)

def send_api_request(self, method, url, params={}, valid_parameters=[], needs_api_key=False):
def send_api_request(self, method, url, params={}, valid_parameters=[], needs_api_key=False, use_body=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while i'm not exactly sure what to do here, this feels a bit weird for a few reasons:

  1. this is a parameter that is only really available when method == "delete"
  2. this means that we cannot use both query parameters and body parameters

i think the ideal here would be to have two separate arguments, query_params and body_params so we have the ability to send both. its not following any best practices to go that route, but it does cover all the bases so we can handle oddities that exist in various legacy api routes.

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

Successfully merging this pull request may close these issues.

2 participants