简体   繁体   English

objc POST文件和字符串参数

[英]objc POST file and string parameters

I am trying to POST a file, and some string params to a .ashx page on my server from my iPad app using objc. 我正在尝试使用objc从我的iPad应用程序将文件和一些字符串参数发布到服务器上的.ashx页面。

I have found lots of tutorials on how to post a file using objc, and I already have code to post strings. 我已经找到了很多有关如何使用objc发布文件的教程,并且我已经有发布字符串的代码。 But I cant work out how to combine the two, so I can send multiple values in a single POST? 但是我无法弄清楚如何将两者结合起来,因此可以在一个POST中发送多个值?

Could anyone help me out with an example or two? 有人可以帮我举两个例子吗? I am trying to avoid using 3rd party frameworks, so something using NSURLRequest would be preferred. 我试图避免使用第3方框架,因此首选使用NSURLRequest。

Thanks, 谢谢,

Mike 麦克风

您需要使用包含边界字符串等的分段提交。这是一些帮助程序代码: https : //github.com/Goles/SimpleHttp请求此问题的答案: 从iOS发送分段POST并在PHP $ _POST中读取参数?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM