我从 iOS 调用 Web API,我调用方法 POST,我不能在 post 方法中传递参数
网络接口:
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?