iOSからWebAPIを呼び出し、メソッドPOSTを呼び出し、postメソッドでパラメーターを渡すことができません
Web API:
public class Person
{
public int Id { get; set; }
public String Name { get; set; }
}
// POST api/values
public void Post([FromBody]Person value)
{
}
iOSの場合
NSURL *url =[NSURL URLWithString:@"http://localhost:9281/api/values"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
[theRequest setHTTPMethod:@"POST"];
NSURLConnection *theConnection = [[NSURLConnection alloc]initWithRequest:theRequest delegate:self];
POSTメソッドで値パラメーターPersonを渡す方法は?