FlareSolverr / FlareSolverr

Proxy server to bypass Cloudflare protection
MIT License
7.2k stars 616 forks source link

Issue with Sending Numeric Values via POST #1194

Open quwest opened 3 months ago

quwest commented 3 months ago

Have you checked our README?

Have you followed our Troubleshooting?

Is there already an issue for your problem?

Have you checked the discussions?

Environment

- FlareSolverr version: latest
- Last working FlareSolverr version: latest
- Operating system: MacOs
- Are you using Docker: [yes/no] yes
- FlareSolverr User-Agent (see log traces or / endpoint):
- Are you using a VPN: [yes/no] no
- Are you using a Proxy: [yes/no] no
- Are you using Captcha Solver: [yes/no] no
- If using captcha solver, which one:
- URL to test this issue: https://core-api.prod.blur.io/v1/orders/format

Description

Endpoint "https://core-api.prod.blur.io/v1/orders/format" requires sending one value as an Integer (feeRate in This Example)

{
  "marketplace": "BLUR",
  "orders": [
    {
      "price": {
        "amount": "0.94",
        "unit": "ETH"
      },
      "tokenId": "2041",
      "feeRate": 50,
      "contractAddress": "0xfdf5acd92840e796955736b1bb9cc832740744ba",
      "expirationTime": "2024-05-22T10:11:05.699Z"
    }
  ]
}

However, the API does not support this due to the use of application/x-www-form-urlencoded. I receive the following response:

{'statusCode': 400, 'message': ['orders.0.feeRate must be a number conforming to the specified constraints'], 'error': 'Bad Request'}

data sent: marketplace=BLUR&orders%5B0%5D%5Bprice%5D%5Bamount%5D=0.94&orders%5B0%5D%5Bprice%5D%5Bunit%5D=ETH&orders%5B0%5D%5BtokenId%5D=2041&orders%5B0%5D%5BfeeRate%5D=50&orders%5B0%5D%5BcontractAddress%5D=0xfdf5acd92840e796955736b1bb9cc832740744ba&orders%5B0%5D%5BexpirationTime%5D=2024-05-22T12%3A08%3A12.975911Z

Logged Error Messages

.

Screenshots

No response

mynameisbogdan commented 1 month ago

I'm confused by this issue, your example is a JSON body but you seem to use form data to send to actually the request. Why don't you send the JSON object as data in a POST request? Or is FS the one doing the transformation?