阅读背景:

将图像上传到iOS Objective C中的AWS EC2服务器

来源:互联网 

I am trying to upload an image to an Amazon EC2 server using AFNetworking for an iOS app. In my research I found this following line to use from here:

我正在尝试使用AFNetworking将图像上传到Amazon EC2服务器以用于iOS应用。在我的研究中,我从这里找到了以下这一行:

[manager POST:@"https://example.com/resources.json" parameters:parameters constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
    [formData appendPartWithFormData:imageData name:@"image"];
} success:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"Success: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", error);
}];

May I know what do I insert accordingly for "parameters"? Is "parameters" the authenticating key between the app and my server? I have an AppKeyPair.pem from the server instance and a username/password to connect to the instance via a remote desktop.

我可以知道我为“参数”相应地插入了什么? “参数”是应用程序和我的服务器之间的身份验证密钥吗?我有一个来自服务器实例的AppKeyPair.pem和一个用户名/密码,通过远程桌面连接到实例。

1 个解决方案

#1


0  

I have realised by now that parameters is not needed and can be put as nil if your php side script does not require it, ie, it is purely by requirement of your server side script.

我现在已经意识到不需要参数,如果你的php端脚本不需要它,可以把它设置为nil,即它纯粹是你的服务器端脚本的要求。


分享到: