0

I am trying to pass Date and time to HTTP GET API. It works well with just date. But I get following error when i try to pass time along with it.

"A potentially dangerous Request.Path value was detected from the client (:)."

The url is something like this "http://localhost:49123/api/books/2000-01-31T00%3A00%3A00"

Any suggestions will be appreciated.

sansy
  • 129
  • 7
  • https://stackoverflow.com/questions/5967103/a-potentially-dangerous-request-path-value-was-detected-from-the-client look at this. – hakantopuz Jun 06 '18 at 07:14
  • URL-encode your time parameter. The reason for the exception is the `:` in the time parameter – schlonzo Jun 06 '18 at 07:18
  • even with time encoded, i am getting error. I have mentioned the URL in the question – sansy Jun 06 '18 at 07:36

1 Answers1

0

Usually this exception is thrown when the URL indeed contains a dangerous character like a "*", "&", "?".

Use some kind of urlencoding. It should be https://www.w3schools.com/asp/met_urlencode.asp

YingYang
  • 378
  • 1
  • 5
  • 15