1

I am using jersey to create restful webservices. While using curl to consume webservices with parameter values with white space, I get 404 not found issue. What should be done to mitigate this problem.

Request

curl -X GET http://api.local.com:8080/v2/parameters**/parameter1/hello world world** /parameter2/world

Response HTTP Status 404 - Not Found

Sabuj Hassan
  • 38,281
  • 14
  • 75
  • 85
shakeelstha
  • 23
  • 1
  • 6

2 Answers2

0

URL encode the string before passing it, (I have not used jersey before so I can not aid it how to do this).

Linx
  • 156
  • 2
0

Use double quote(") around your URL as you have space in it. Also by default its GET request. So remove the -X GET

curl "http://api.local.com:8080/v2/parameters**/parameter1/hello world world** /parameter2/world"
Sabuj Hassan
  • 38,281
  • 14
  • 75
  • 85