1

I have a table a with columns like pageId and page_name where values are inserted line [1,https://google.com] and so on.

Now i created an api that takes the URL and returns the pageid, so now the scenario is like:

localhost:8080/api/v1/page/https://google.com

whenever i am trying to pass it via Postman is is showing Could not send response can anyone help me to fix this problem?

3
  • url syntax doesn't seem correct. Commented Jun 29, 2020 at 10:44
  • In such a case it's better to use parameters than path values. But anyway, try to URI-encode the URL. Commented Jun 29, 2020 at 10:45
  • Hi @RealSkeptic , it worked, as i used parameter instead of path variable. Thank you so much for your quick reply. please answer the question so that i can accept it, that could help others. Commented Jun 29, 2020 at 10:55

2 Answers 2

1

The problem is that you have reserved chars in your query param.

Consider encoding your text.

So: http://www.google.com

will become: http%3A%2F%2Fwww.google.com

Sign up to request clarification or add additional context in comments.

Comments

-1
localhost:8080/api/v1/page/https://google.com

According url format documentation (see for example this article )- impossible use reserved chars (: and /) as parameters. I reccoment use something like

localhost:8080/api/v1/page/google.com

And add "https://" in service

or use

localhost:8080/api/v1/page/https~~google.com 

And replaced "~~" to "://".

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.