gnuns / allOrigins

:alien: Pull content from any page as JSON via API

Home Page:https://allorigins.win/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Params from requests are dropped

FrantisekHrdina opened this issue · comments

Hi, I am sending this request
curl -X GET "https://api.allorigins.win/raw?url=https://api.nhle.com/stats/rest/en/skater/summary?isAggregate=false&isGame=false&sort=%5B%7B%22property%22:%22points%22,%22direction%22:%22DESC%22%7D,%7B%22property%22:%22goals%22,%22direction%22:%22DESC%22%7D,%7B%22property%22:%22assists%22,%22direction%22:%22DESC%22%7D%5D&start=0&limit=50&factCayenneExp=gamesPlayed%3E=1&cayenneExp=gameTypeId=2%20and%20nationalityCode=%22CZE%22%20and%20seasonId%3C=20202021%20and%20seasonId%3E=20202021"

but the response is different from expected, probably some parameters of the request are dropped by proxy. I am not sure, if I am using it well, or if it is a bug. Can you give me some advice on preventing dropping those params, if I am doing it badly? Thank you.

Hi, @FrantisekHrdina!
You need to encode the target URL before using it as a parameter. You can do this using JS's encodeURIComponent() or something like urldecode.org.

e.g.:

curl -X GET "https://api.allorigins.win/raw?url=https%3A%2F%2Fapi.nhle.com%2Fstats%2Frest%2Fen%2Fskater%2Fsummary%3FisAggregate%3Dfalse%26isGame%3Dfalse%26sort%3D%255B%257B%2522property%2522%3A%2522points%2522%2C%2522direction%2522%3A%2522DESC%2522%257D%2C%257B%2522property%2522%3A%2522goals%2522%2C%2522direction%2522%3A%2522DESC%2522%257D%2C%257B%2522property%2522%3A%2522assists%2522%2C%2522direction%2522%3A%2522DESC%2522%257D%255D%26start%3D0%26limit%3D50%26factCayenneExp%3DgamesPlayed%253E%3D1%26cayenneExp%3DgameTypeId%3D2%2520and%2520nationalityCode%3D%2522CZE%2522%2520and%2520seasonId%253C%3D20202021%2520and%2520seasonId%253E%3D20202021"