c# - How do I send the following sample message as query string? -
sample message :login=admin&password=password&tranid=0617759203&trantype=9220
i have wcf service following method
[operationcontract(name = "getsamplemethod")] [webget(uritemplate = "getsamplemethod/inputstr/{data}")] string getsamplemethod(string data);
i able send single string /service.svc/getsamplemethod/inputstr/abc data. when tried send sample message data getting following error:
a potentially dangerous request.path value detected client (&).
description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code.
exception details: system.web.httpexception: potentially dangerous request.path value detected client (&).
source error:
an unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below.
stack trace:
[httpexception (0x80004005): potentially dangerous request.path value detected client (&).]
system.web.httprequest.validateinputifrequiredbyconfig() +9672068
system.web.pipelinestepmanager.validatehelper(httpcontext context) +53
could please me this? how need send type of message query string?
you need http encode values you're sending in query string. in order words, "&tranid=0617759203" becomes (minus space) "& amp;tranidtranid=0617759203" can sent on http.
Comments
Post a Comment