its-rigs / Trolly

A Python wrapper around the Trello API. Provides a group of Python classes to represent Trello Objects. All classes come with basic Trello API method calls and are easily extensible to suit your needs. See the README for more details.
MIT License
100 stars 29 forks source link

Use body instead of query_params for PUT and POST requests #43

Closed wolph closed 10 months ago

wolph commented 8 years ago

RIght now some (all?) of the PUT and POSt requests use query parameters to send the values, with large values that can cause errors since the url becomes too long. I propose changing them to json bodies instead.

For example, in the case of the update_card method in card.py:

def update_card(self, query_params=None):
    '''
    Update information for this card. Returns a new Card object.
    '''
    card_json = self.fetch_json(
        uri_path=self.base_uri,
        http_method='PUT',
        body=json.dumps(query_params),
    )
    return self.create_card(card_json)

Works fine except that it accepts much more data :)

its-rigs commented 8 years ago

Yeah good point. Been a while since I did any major work on this. My plan is to start separating this out a bit more, starting with the http requests, so I'll abstract this out then.