Debby
Debby

Reputation: 23

Long complicated URIs

I have a webservice to give access to some resources on a network. The service has a method to look for the resource and returns the path of the resource. Another method, send to request to the webservice with this path.

I try to pass the entire UNC path (encoded with HttpServerUtlility.UrlTokenEncode method) to the webservice. The resulting URI is very long (331 characters) and I get "HTTP 400 Bad Request".

How do I handle such long URIs? If my URI is shorter by some 10 characters, then the request goes through. Unfortunately, the size of URI is variable and can be more in some case. What changes do I need to make? Are there any setting in config file to allow for long URIs?

Upvotes: 0

Views: 128

Answers (1)

Bill Barry
Bill Barry

Reputation: 3543

Enumerate the resources you want to give access to and store a dictionary/sql table to them indexed by guid.

ex:

3941dbffc1b54581837010a42b42635d = //server/path/to/file

the first method would return the guid, and the second would look up the guid to find the file

Upvotes: 1

Related Questions