Using ASIHTTPRequest in an iOS project

1) Add the files

Copy the files you need to your project folder, and add them to your Xcode project. An overview of the ASIHTTPRequest source files appears here.

If you aren‘t sure which files you need, it‘s best to copy all the following files:

  • ASIHTTPRequestConfig.h
  • ASIHTTPRequestDelegate.h
  • ASIProgressDelegate.h
  • ASICacheDelegate.h
  • ASIHTTPRequest.h
  • ASIHTTPRequest.m
  • ASIDataCompressor.h
  • ASIDataCompressor.m
  • ASIDataDecompressor.h
  • ASIDataDecompressor.m
  • ASIFormDataRequest.h
  • ASIInputStream.h
  • ASIInputStream.m
  • ASIFormDataRequest.m
  • ASINetworkQueue.h
  • ASINetworkQueue.m
  • ASIDownloadCache.h
  • ASIDownloadCache.m

iPhone projects must also include:

  • ASIAuthenticationDialog.h
  • ASIAuthenticationDialog.m
  • Reachability.h (in the External/Reachability folder)
  • Reachability.m (in the External/Reachability folder)

2) Link with CFNetwork, SystemConfiguration, MobileCoreServices, CoreGraphics and zlib

Open the settings for your target by clicking on the blue bar at the very top of the Xcode sidebar:

Open the Build Phases tab, expand the box labeled Link Binary With Libraries then click the plus button.

Choose CFNetwork.framework from the list, and click Add:

Repeat the last two steps to add the following: SystemConfiguration.frameworkMobileCoreServices.framework,CoreGraphics.framework and libz.dylib.

Using ASIHTTPRequest in a Mac OS X project

To use ASIHTTPRequest in a Mac project, you‘ll need to link against:

  • SystemConfiguration.framework + zlib (as above)
  • CoreServices.framework
    CFNetwork is part of the CoreServices framework on Mac OS X. Unless you are writing a console-based application, your application is probably already setup to link with CoreServices, but if not, simply add CoreServices.framework in the same way as described above.

Building the tests

Most users can skip this part!

The tests that come with ASIHTTPRequest primarily exist for my benefit, so I can check I haven’t broken something when I make changes. You only need to run the tests if you are making changes to ASIHTTPRequest, or want to confirm that something is working as expected.

ASIHTTPRequest uses Gabriel Handford’s wonderful GHUnit framework for running tests.

As of v1.8-50, GHUnit is no longer included as a git submodule. Instead, build scripts automatically download a pre-compiled framework if one does not already exist locally. If you would prefer to build GHUnit yourself, simply grab a copy from GitHub, and drop your built framework in External/GHUnit.

Some of the tests require additional information to run:

    • To run the S3 tests, you need to specify your S3 access details in the top of ASIS3RequestTests.m
    • To run the proxy tests, you need to specify details of your proxy server, and a PAC file if you want to run the PAC tests. Note that the proxy tests require a proxy server, while all the other tests require that you don‘t have a proxy server.
时间: 2024-10-05 05:44:12

Using ASIHTTPRequest in an iOS project的相关文章

Adding a prefix header to an iOS project

The iOS SDK API for New Relic Mobile requires modification of your project's prefix header. If your project does not have one, follow these steps to add it.From your Xcode menu, select File > New > File...From iOS template options, select Other >

iOS项目添加.pch文件 / How to add a .pch file to an iOS project

1.Create a .pch file. 2.Write your macro, headfiles or something. Here is my prefixHeader.pch 3.Choose the Project and select "Build Settings" >>> find with keywords "prefix" >>>make the "Precompile Prefix Header

[Unity插件]iOS Project Builder for Unity

https://www.assetstore.unity3d.com/en/#!/content/15522 主要功能: 可以在Windows环境下编译iOS工程. 首先要到Mac机上执行一个脚本打包SDK文件, 然后复制到Windows环境下. 帮助中建议用FAT32的U盘, 我建议在Mac上安装Mounty. PC上再执行一个脚本解压SDK文件. 然后直接运行GUI编译即可, 也提供命令行方式编译. 试用感受: 1) 还没有使用第三方插件, 目前编译没遇到什么问题. 2) 还没有试过正式上传

对比iOS网络组件:AFNetworking VS ASIHTTPRequest

对比iOS网络组件:AFNetworking VS ASIHTTPRequest 在开发iOS应用过程中,如何高效的与服务端API进行数据交换,是一个常见问题.一般开发者都会选择一个第三方的网络组件作为服务,以提高开发效率和稳定性.这些组件把复杂的网络底层操作封装成友好的类和方法,并且加入异常处理等. 那么,大家最常用的组件是什么?这些组件是如何提升开发效率和稳定性的?哪一款组件适合自己,是 AFNetworking(AFN)还是 ASIHTTPRequest(ASI)?几乎每一个iOS互联网应

iOS通过ASIHTTPRequest提交JSON数据

先验知识——什么是ASIHTTPRequest? 使用iOS SDK中的HTTP网络请求API,相当的复杂,调用很繁琐,ASIHTTPRequest就是一个对CFNetwork API进行了封装,并且使用起来非常简单的一套API,用Objective-C编写,可以很好的应用在Mac OS X系统和iOS平台的应用程序中.ASIHTTPRequest适用于基本的HTTP请求,和基于REST的服务之间的交互. 如何使用ASIHTTPRequest? 网上有很多专门介绍ASIHTTPRequest使用

很好的iOS学习资料

https://github.com/vsouza/awesome-ios 汇集了很多好的资料 https://github.com/vsouza/awesome-ios Skip to content This repository Pull requests Issues Gist You don’t have any verified emails. We recommend verifying at least one email. Email verification helps ou

ASIHTTPREQUEST 文档

Please note that I am no longer working on this library - you may want to consider using something else for new projects. :) ASIHTTPRequest documentation Last updated: 15th May 2011 (v1.8.1) About Setup instructions How to use it Amazon S3 Rackspace

ThemeableBrowser在IOS中按钮图片的使用

1. 首先确保图片的名称为 ***@1x.png, ***@2x.png 或 ***@3x.png iPhone -- iPhone3GS ***@1x.png iPhone -- iPhone6 ***@2x.png iPhone 6 Plus and above ***@3x.png 2. 复制图片到以下目录 <cordova_project_root>/platforms/ios/<project_name>/ResourcesResources文件夹不存在的话,请自行创建.

第一个iOS App RadioStation

同样来自Mitch, Bennett, Lees的教材,本人编译环境为Xcode 7 新建IOS Project, SingleView Application. 在Xcode环境中 - UI布局,添加UI对象,链接UI组件和UI对象. UI布局:通过拖曳右下角的UI组件到Main.Storyboard中的空白Layout中     添加UI对象 本例中在ViewController的实例变量中添加了 IBOutlet类的各个UI组件的对象 - 对应三个动态Label,一个Slider 在类外面