Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
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