I have a requirement where I need to pass URL's to a REST API as a parameter. I have tried encoding the url but I still get an HTTP 400 error code. for example
One of my sample REST API is
/rest/pull/{http://www.google.com}/net
I have tried encoding the url which results in
/res开发者_StackOverflow社区t/pull/http%3A%2F%2Fwww.google.com/net
but this still results in an error on the REST call. What do I need to do differently?
Try escaping dots too /rest/pull/http%3A%2F%2Fwww%2Egoogle%2Ecom/net
BTW having rest
in your APi does not make it RESTful. Start with defining resources and operations.
精彩评论