Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Passing POST parameters into Web API using Postman

$
0
0

Hi,

I have created a Web API and defined the API Controller:

//Post api/<controller>
public IEnumerable<siteLogin> Post([FromBody]string siteId, [FromBody]string sitePassword)
{
   List<siteLogin> siteLoginList = new List<siteLogin>();

   //Process input...

   return siteLoginList;
}

I'm using Postman to test the API. I can't get the API to accept the parameters I pass. It returns a 500 error each time with no further info. Here is how I'm passing the parameters in using Postman:

Just to test, I removed the parameters in the controller and did a POST without any parameters. It works fine. So there is no issue with connecting to the API.

Is there a problem with my controller definition or the Postman parameters?


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>