dongshi949737 2009-07-25 09:40
浏览 39
已采纳

将iPhone HTTP请求发送到Apache PHP Web服务器

I am programmer with a games and 3D graphics background and at the moment I would like to brush up on my networking and web development skills.

I have a task that I would like to accomplish to do this. My idea is that I would like to be able to send a HTTP request or something similar to my webserver, which runs a LAMP based setup. I would like to know how I can send a HTTP request containing some information from my iPhone using the Cocoa Touch framework, to my webserver.

I would like the webserver (using PHP) to be able to record the sent information into a plain text file, that I can use later to make graphs. For my example we could just send the current date.

I think that people must do this very often and I really want to know how to do this. Thanks for your help.

P.S. If you don't know the Cocoa code in order to send the request, that's okay I'm sure I can figure that out, but I would like to at least know how to get the Linux server to save the HTTP request, preferrably PHP but another appropriate language is fine. Bonus marks for away to do this securely.

Also: I am a total noob at this and require source code, cheers :D

  • 写回答

3条回答 默认 最新

  • douxuanjie2692 2009-07-27 04:18
    关注

    You really can't go past a library like ASIHTTPRequest if you need to make HTTP requests from an iPhone or Mac client to a web server. The documentation is very good, and covers all the important topics like:

    • asynchronous vs synchronous requests
    • sending data to the server
    • tracking upload/download progress
    • handling authentication
    • using the keychain for storage of credentials
    • compressing request bodies with gzip

    You should check it out -- it will make your life much easier.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建