我已经在发送HTTP POST的Objective-C的发送方法和身体我把一个字符串:HTTP POST随着身体
NSString *requestBody = [NSString stringWithFormat:@"mystring"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[requestBody dataUsingEncoding:NSUTF8StringEncoding]];
现在
在Android的我想要做同样的事情,我找一种设置http post的主体的方法。
以及我如何将urlconnection连接到http post? – MTA
我已在上面添加更多代码以帮助您 – Suchi
我认为需要添加:'urlConn.setDoOutput(true);' –