-1

I am supposed to send a path (e.g "d:\something\something") as a parameter to GET call to WebAPI. Here is my action method in ApiController

    // GET api/values
    public List<image> Get(string path)
    {
        //return repo.getImages(@"C:\My Data\SEAGATE3TB\PICTURES");
        return repo.getImages(path);
    }

I am not sure how I can achieve this. Testing this in browser with url http://localhost:86/api/values/C:/My%20Data/SEAGATE3TB/PICTURES/2005 shows

Server Error in '/' Application.

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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (:).

How can I send a path to my controller?

Community
  • 1
  • 1
Sherebyah Tishbi
  • 123
  • 1
  • 10

1 Answers1

0

Please ignore. I was executing totally nonsense url.

Sherebyah Tishbi
  • 123
  • 1
  • 10