0

I am passing in a URL as a parameter

GET http://127.0.0.1:5000/?url=https://url.com/?param1=123&param2=456

When I grab the URL parameter with request.args.get('url') the value returned is https://url.com/?param1=123 so its stripping off the second parameter in the URL

How can I get all parameters?

2
  • 1
    you need use from urllib import urlencode encode your url Commented Apr 30, 2019 at 3:15
  • If it's possible, I think you'd want to URIencode that url param. Is that an option? Commented Apr 30, 2019 at 3:16

1 Answer 1

1

You should encode your url, like this

http://127.0.0.1:5000/?url=https%3A%2F%2Furl.com%2F%3Fparam1%3D123%26param2%3D456

use python3

from urllib.parse import urlencode

get_url = '?'.join(['http://127.0.0.1:5000/', urlencode({'url': 'https://url.com/?param1=123&param2=456'})])
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.