0

I've got a quick question, is it possible to include raw url in request params? I guess that it is a problem with additional // that confuses Postman, which I am using or I have to create a special request handler in my server.

http://localhost:5000/api/https://google.com

Here is how I try to handle this in my node.js express server

app.use('/api/:url')

I know that I can overcome this by changing my api and include this in body, but I want to do this that way

Mesmer
  • 59
  • 4

1 Answers1

1

The typical way to handle this is to use URL encoding.

For example, I want to include http://my-raw-url as the query param url in http://wrapper.com. The URL would look like this:

http://wrapper.com?url=http%3A%2F%2Fmy-raw-url

Your backend code will need decode it back. All modern languages have easy-to-use libraries how to do it.

root
  • 5,528
  • 1
  • 7
  • 15