Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Path params and hitting URL length limit (Unexpected end of JSON input) #30

@TylerSanford

Description

@TylerSanford

Good Evening,

I have been seeing errors in my logs for the last week or so that cropped up from no code change. I use kucoin as my exchange and I update the bot settings when new pairs are added. Over the last few weeks I have seen the coins go from 790 to over 830 and sometime from 820ish I started seeing the exception
FetchError: invalid json response body at https://api.3commas.io/public/api/ver1/bots/** reason: Unexpected end of JSON input

I was still able to use the same endpoint with a smaller list, but I am unable to update the list with all current kucoin USDT pairs.

I propose for POST/PUT calls we use the body instead of a query string within
async makeRequest(method, path, params) { on line 24 in threeCommasAPI class.

From 3Commas documentation:

  • For GET endpoints, parameters must be sent as a query string.
  • For POST, PUT, and DELETE endpoints, the parameters may be sent as a query string or in the request body with content type application/x-www-form-urlencoded or application/json. You may mix parameters between both the query string and request body if you wish to do so.
  • Parameters may be sent in any order.
  • If a parameter sent in both the query string and request body, the query string parameter will be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions