Hey guys, Just wondering if you can help me with my project.
I'm currently attempting to post to a url. I'll provide as much information as possible below without giving out my actual API url out to people since it's client based.
So here is what I'm trying to do, For instance here is my api url.
https://test-to-show-you.com/API/Authentication
I've tried adding the post to the url but that doesn't work because it gives no response for example.
https://test-to-show-you.com/API/Authentication?payload=user%3D
testusername%2Cpassword%3D
testpassword
But when using postman google chrome app, I can post to this fine, obviously not in the url though.
and this is a POST method with Content-Type: application/x-www-form-urlencoded
Here is what I'm trying to post to the url "payload=user%3D
testusername%2Cpassword%3D
testpassword"
Before going any further I'd just like to say it needs to be exactly like this otherwise you get no response from the server so it needs the
%3D and
%2C in the post method for some strange reason.
Here is what I've currently got coded into my application.
var tasks = new List<Task<string>>();
for (int i = 0; i < accoutList.Count(); i++)
{
int g = i;
var postParameters = new NameValueCollection();
try
{
Accounts ac = accoutList[i];
tasks.Add(Task.Factory.StartNew(() => { return GetWebResponse("https://test-to-show-you.com/API/Authenticate", g); }));
}
catch
{
}
}
So I'm just really stuck here on how to post that exactly to the url inhand. Would appreciate some support into this :)