Reputation: 75
When i passing parameters through querystring in Postman for hitting my Wcfrestfulservices it's working fine. Client POSTMAN ::
in Service ::
public Stream GetFoliosbyPAN(string ApplicationID, string Password, string AppVersion, string DeviceDetails, string Source, string PAN)
But based on client requirement we shouldnot passing parameters through querystring only from body. Like in Postman body:
http://localhost:51462/InvestUtiServices.svc/GetFoliosbyPAN
{
"ApplicationID" : "dfdfd",
"Password" : "sddf",
"AppVersion" : "5.0",
"DeviceDetails" : "10.333.3.33",
"Source" : "website",
"PAN" : "dfdddf"
}
But values are not passing, we get null values when hitting the service.
How can i pass values from body in POSTMAN?
Upvotes: 1
Views: 1171
Reputation: 2178
First of all your method must be a POST method, then only it will accept post parameters.
Second, you are passing parameters as a JSON object
{
"ApplicationID" : "dfdfd",
"Password" : "sddf",
"AppVersion" : "5.0",
"DeviceDetails" : "10.333.3.33",
"Source" : "website",
"PAN" : "dfdddf"
}
So you need to change your method declaration that uses complex object containing all the parameters as properties
From
public Stream GetFoliosbyPAN(string ApplicationID, string Password, string AppVersion, string DeviceDetails, string Source, string PAN)
To
public Stream GetFoliosbyPAN(UserInfo info)
where UserInfo will be a class with your parameters as properties.
Upvotes: 1