当前位置:网站首页>Afnetworking understand
Afnetworking understand
2022-07-26 21:56:00 【51CTO】
AFNetworking understand
AFNetworking It is a likable Network Library , Apply to iOS as well as Mac OS X. It's built on NSURLConnection, NSOperation, And other familiar Foundation Above technology . It has a good architecture , rich api, And modular construction , It makes it very easy to use . for example , He can use a very easy way from a url To get json data :
1 | |
2 | |
3 | |
4 | |
5 | |
6 |
How to get started
- download AFNetworking Then try to use the example inside
- read “Getting Started” guide, FAQ, perhaps other articles in the wiki
- see Complete documentation
- see NSScreencast episode about AFNetworking Get a quick reference , To quickly apply to your app in
- There is a problem ? Stack Overflow Is the best place to find the answer
review
CORE:
AFURLConnectionOperation: One NSOperation Realized NSURLConnection
HTTP Requests:
AFHTTPRequestOperation:AFURLConnectionOperation Subclasses of , When request The protocol used is HTTP and HTTPS when , It compresses the used to decide request Status code and content type of success .
AFJSONRequestOperation:AFHTTPRequestOperation A subclass of , For downloading and processing jason response data .
AFXMLRequestOperation:AFHTTPRequestOperation A subclass of , For downloading and processing xml response data .
AFPropertyListRequestOperation:AFHTTPRequestOperation A subclass of , For downloading and processing property list response data .
HTTP CLIENT:
AFHTTPClient: Capture a based on http Protocol of the network application of the public communication mode . contain :
- Use basic url Relevant path to only do request
- by request Automatically add settings http headers.
- Use http Basic certificate or OAuth To verify request
- citing client To make the requests Manage a NSOperationQueue
- from NSDictionary Generate a query string or http bodies.
- from request Build multiple parts in
- Automatic parsing http response The data is the corresponding performance data
- Monitor and respond to changes in network accessibility testing .
IMAGES
AFImageRequestOperation: One AFHTTPRequestOperation Subclasses of , For downloading and processing pictures .
UIImageView+AFNetworking: Add some methods to UIImageView in , In order to URL Load remote pictures asynchronously in
Example program
XML REQUEST
1 | |
2 | |
3 | |
4 | |
5 | |
6 |
IMAGE REQUEST
1 | |
2 |
API CLIENT REQUEST
1 | |
2 | |
3 | |
4 | |
5 |
FILE UPLOAD WITH PROGRESS CALLBACK
01 | |
02 | |
03 | |
04 | |
05 | |
06 | |
07 | |
08 | |
09 | |
10 | |
11 | |
12 |
STREAMING REQUEST
1 | |
2 | |
3 | |
4 | |
5 | |
6 |
- Last one ios Alipay client application development guide
- Next Campus recruitment in the eyes of an interviewer —— To fresh graduates who are eager to apply for jobs
边栏推荐
- Thoroughly understand the principle and implementation of service discovery
- 也谈数据治理
- 商汤科技发布人脸识别一体机SensePass Pro
- cmake编译obs-studio-27.2.0
- 深入源码剖析String类为什么不可变?(还不明白就来打我)
- imshow()函数后面如果不加waitKey()函数就不显示
- A friend with a monthly salary of 50000 told me that you were just doing chores
- Solution to the problem of sticking and unpacking TCP
- 七、微信小程序运行报错:Error: AppID 不合法,invalid appid
- 小米1亿像素摄像头揭秘:1/1.3英寸COMS传感器、分辨率12032×9024
猜你喜欢
随机推荐
京东一面:Redis 如何实现库存扣减操作?如何防止商品被超卖?
Cmake compiling obs-studio-27.2.0
新来个技术总监要我做一个 IP 属地功能~
Object. getOwnPropertyNames() VS Object.keys()
:active vs :focus
Pytorch torch. add() torch. add_ () usage
If you do not add waitkey() function after imshow() function, it will not be displayed
Go----Go语言中的变量使用方法
攻防世界----ics-07
VI and VIM text editors
Pbootcms一级栏目下的二级三级栏目高亮
In depth interpretation of happens before principle
My SQL is OK. Why is it still so slow? MySQL locking rules
七月集训(第26天) —— 并查集
Circular progress bar animation based on cashapelayer and Bezier curve
2022年简历石沉大海,别投了,软件测试岗位饱和了....
A friend with a monthly salary of 50000 told me that you were just doing chores
会用redis吗?那还不快来了解下redis protocol
从手动测试,到自动化测试老司机,只用了几个月,我的薪资翻了一倍
July training (the 26th day) - and check the collection









