Skip to content

How to do you proxy a URL that also requires arguments? #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jun 3, 2017 · 2 comments
Closed

How to do you proxy a URL that also requires arguments? #24

ghost opened this issue Jun 3, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 3, 2017

I am using this proxy by using the hosted link as so:
http://proxy.hackeryou.com/?reqUrl=http://example.com

This code works, however, the specific website I am using ALSO has arguments it must take, and the hosted website thinks that when I add multiple arguments, the new arguments are actually for the proxy itself and not the website I am trying to proxy.

http://proxy.hackeryou.com/?reqUrl=http://example.com?getPage=1&doCache=false
How do I create a solution to this?

@Rchristiani
Copy link

Hi,

That is what the params key is for. If you are using something like jQuery you can pass the data like this:

$.ajax({
	url: 'http://proxy.hackeryou.com',
	dataType: 'json',
	method:'GET',
	data: {
		reqUrl: 'http://example.com',
		params: {
			getPage: 1,
                        doCache: false
		}
	}
}).then(function(res) {
	...
});

If you need to just write the request out by hand, you can do this.

http://proxy.hackeryou.com/?reqUrl=http://example.com&params[getPage]=1&params[doCache]=false

Hope that helps.

@ghost
Copy link
Author

ghost commented Jun 4, 2017

Thank you so much! This is just what I needed.

@ghost ghost closed this as completed Jun 4, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant