Hi,
I am trying to test a ASP.NET Webapi method using fiddler. I have a method which accepts XML in the form of a string parameter. I know its not a good design, but I am in the process of porting a legacy WCF implementation to Webapi and initially I have to keep the method signature as is and then eventually I can make it to follow a better design. Anyway, so here is my method signature.
[HttpPost]
public int CreatePGT([FromBody] string pgtXml, [FromUri] string transactionId)
{
return 10; // Some processing happens and actual implementation returns an id
}
How can I compose a request using following URL http://localhost:62050/api/proposal/CreatePGT?transactionId=ttt and post the following xml string in request body
<?xml version="1.0" encoding="UTF-8" ?><PGT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="pgt.xsd">
<title>Test Proposal</title></PGT>
I am trying to test a ASP.NET Webapi method using fiddler. I have a method which accepts XML in the form of a string parameter. I know its not a good design, but I am in the process of porting a legacy WCF implementation to Webapi and initially I have to keep the method signature as is and then eventually I can make it to follow a better design. Anyway, so here is my method signature.
[HttpPost]
public int CreatePGT([FromBody] string pgtXml, [FromUri] string transactionId)
{
return 10; // Some processing happens and actual implementation returns an id
}
How can I compose a request using following URL http://localhost:62050/api/proposal/CreatePGT?transactionId=ttt and post the following xml string in request body
<?xml version="1.0" encoding="UTF-8" ?><PGT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="pgt.xsd">
<title>Test Proposal</title></PGT>