Andy Obusek..

22

以下是使用NSURLConnection发送POST参数的示例:

// Note that the URL is the "action" URL parameter from the form.

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.whereq.com:8079/answer.m"]];

[request setHTTPMethod:@"POST"];

[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];

//this is hard coded based on your suggested values, obviously you'd probably need to make this more dynamic based on your application's specific data to send

NSString *postString = @"paperid=6&q77=2&q80=blah";

NSData *data = [postString dataUsingEncoding:NSUTF8StringEncoding];

[request setHTTPBody:data];

[request setValue:[NSString stringWithFormat:@"%u", [data length]] forHTTPHeaderField:@"Content-Length"];

[NSURLConnection connectionWithRequest:request delegate:self];

Android ios 表单提交,如何在iOS上模拟HTTP表单(POST)提交相关推荐

  1. ios 跨域_如何在iOS和Android中建立跨域通信桥

    ios 跨域 I was working on a certain project at work, in which I needed to connect several varying comp ...

  2. ios 动态化视图_如何在iOS应用中使高度收集视图动态化

    ios 动态化视图 by Payal Gupta 通过Payal Gupta 如何在iOS应用中使集合视图的高度动态化 (How to make height of collection views ...

  3. php mysql 到表最后_如何在PHP中获取MySQL表的最后插入ID?

    如何在PHP中获取MySQL表的最后插入ID? 我有一张表,经常插入新数据. 我需要获取表格的最后一个ID. 我怎样才能做到这一点? 它类似于SELECT MAX(id) FROM table吗? g ...

  4. suse linux 单用户,如何在 SUSE 12 Linux 中进入单用户模式?

    原标题:如何在 SUSE 12 Linux 中进入单用户模式? 编译自: https://kerneltalks.com/howto/how-to-enter-single-user-mode-in- ...

  5. ios手写_如何在iOS 10中发送手写和数字触摸消息

    ios手写 We live in a very high-tech world. We walk around with our heads bowed down to our phones tapp ...

  6. ios 启用 证书_如何在iOS 10中启用就寝提醒,轻柔的唤醒和睡眠跟踪

    ios 启用 证书 If you have trouble regularly getting a full night's sleep, the new Bedtime feature in iOS ...

  7. mac安装ios应用程序_如何在Mac上安装应用程序:您需要知道的一切

    mac安装ios应用程序 If you're switching to macOS from Windows, you might be confused about installing softw ...

  8. python post 上传文件_如何在 Python 中模拟 post 表单来上传文件

    展开全部 发个以前用urllib2模块来做的62616964757a686964616fe4b893e5b19e31333335343366class HTTPError(urllib2.HTTPDe ...

  9. plsql tables 没有表_技术分享 | 在磁盘上查找 MySQL 表的大小

    作者:Peter Zaitsev 翻译:管长龙 我想知道 MySQL 表在磁盘上占用多少空间,但看起来很琐碎.不应该在 INFORMATION_SCHEMA.TABLES 中提供这些信息吗?没那么简单 ...

最新文章

  1. centos和readhat下安装python2.7
  2. chrome浏览器调试手机端h5页面
  3. quick cocos2d x 手机(Android端)启动过程学习
  4. mysql 查询设置调优_MySQl 查询性能优化相关
  5. hive选择mariadb还是mysql_Hive MariaDb的安装
  6. leetcode 滑动窗口小结 (三)
  7. Apache的Mod_rewrite学习(RewriteRule重写规则的语法)
  8. it计算机知识竞赛主持稿,西安交大城市学院计算机系举办第四届“走进IT,触碰未来”计算机知识竞赛...
  9. Qt_发送邮件(以qq邮箱为例)
  10. CUDA学习之第三章:CUDA执行模型--part1
  11. Android串口调试工具ComAssistant下载
  12. Linux 终端快捷键
  13. Mini-C编译器设计与实现 文档+任务书+评价表+PPT+项目源码
  14. Word目录:【同一篇文档设置多个独立目录】详细过程
  15. Miracle密码算法开源库(二)源码分析 :mralloc.c、mrarth0.c
  16. 计操实验 多级反馈队列C语言
  17. mac OS下的资源限制 以及 引出的ulimit, launchctl, sysctl区别
  18. 【转载】生产订单完工确认(CO11N) BAPI : BAPI_PRODORDCONF_CREATE_TT
  19. “数据闭环定义芯片”助力汽车智能化升级,辉羲智能亮相上海车展
  20. c语言中八进制和十六进制

热门文章

  1. 自定义类型:结构体2.0(初阶+进阶)+位段+枚举+联合
  2. 应用程序无法正常启动(oxc000007b):解决方案
  3. Android studio系列:win10上Android studio4.0.2下载安装
  4. AVFoundation学习记录
  5. 十分钟开发出神经网络五子棋
  6. UEFI 界面实例解析
  7. 解决ListView显示不全、滑动冲突问题
  8. tcl/tk参考——列表操作lsearch
  9. [量化-033]金融哲学-道德经解读-004-道德经最好理解的部分
  10. golang EXE程序添加图标和详细信息(版本号,版权,公司信息等)