graphsense / graphsense-python

A Python client for the GraphSense REST interface.
MIT License
19 stars 5 forks source link

Request line too long in list_addresses #4

Closed behas closed 3 years ago

behas commented 3 years ago

I received the following error when requesting more than 100 addresses in a single request:

Exception when calling AddressesApi: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Connection': 'close', 'Content-Type': 'text/html', 'Content-Length': '163'})
HTTP response body: <html>
  <head>
    <title>Bad Request</title>
  </head>
  <body>
    <h1><p>Bad Request</p></h1>
    Request Line is too large (4117 &gt; 4094)
  </body>
</html>

If there is a limit, the API should inform the user about the limit. Is there a code snippet that shows how to retrieve a large number of address objects, possibly with several list_addresses calls?

myrho commented 3 years ago

The limit is 1000. The problem here is with the proxy which seems not to be configured to accept long request lines. Explanations continue interally!

myrho commented 3 years ago

One can iterate through the next_page handle, eg:

        while api_response is None or page is not None:
            api_response = api_instance.list_addresses(currency, page=page)
            page = api_response.next_page