Home > front end >  Problem with using https://allorigins.win/ to Pass Cors when my link has parameters in it
Problem with using https://allorigins.win/ to Pass Cors when my link has parameters in it

Time:09-29

I would like to use this website's service raw?url= API but there is problem when my own link contains a few parameters. example:

api: https://api.allorigins.win/raw?url=
destination: https://nocors2.glitch.me/webm?a=b&c=d

Seems they will confuse the link's parameters as the API's parameters when requesting. I would like to know if you can think of any solution I can pass this problem?

i need a service to let me pass Cors restriction without making my own server, so far this website was the best thats why i would like to solve this.

Thanks

CodePudding user response:

You need to encode your URL since it's a parameter. See RFC 3986 for more details.

For JavaScript, this would be:

"https://api.allorigins.win/raw?url="   encodeURIComponent("https://nocors2.glitch.me/webm?a=b&c=d");
  • Related