I am using this line
client.PostAsync("mysite.net/login.asmx/login", content);
And I need that my content be something like id=21&name=myname&password=pass&json=1 It should be a string but the accepted type here is a FormUrlEncodedContent and because of that I don't know how this class create the value, if it works like a json or not and if it will change this structure id=21&name=myname&password=pass&json=1 that I need (it should be the rest of the url) How can I send it and receive the response converting it to my class user, for example?
I am using it as well
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("id", "125"),
new KeyValuePair<string, string>("mailadress", login),
new KeyValuePair<string, string>("password", pass),
new KeyValuePair<string, string>("json", "1"),
});
How my webservice will receive it? how this class(above) organize the key-value?
my class
class User
{
public string codigo { get; set; }
public string nome { get; set; }
public string email { get; set; }
public string senha { get; set; }
public string imagem { get; set; }
public DateTime dataDeNasc { get; set;}
public string cidade { get; set; }
public string estado { get; set; }
public string telefone { get; set; }
public string sexo { get; set; }
}
Thank you very much. I really need this help
receive the response converting it to my class userPlease include the source code for user.