当前位置:网站首页>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
边栏推荐
- 7、 Wechat applet running error: error: illegal appid, invalid appid
- LDAP——实现用户统一登录管理
- Li Kou daily question - day 43 -168. Name of Excel table column
- Ren Zhengfei talked about the suppression of the United States again: to live is to win, and to defeat the United States
- 新来个技术总监要我做一个 IP 属地功能~
- 1 - "pytorch deep learning practice" - linear model
- 成功上岸了自动化测试岗,最高月薪15.4K,自己真棒~
- 彻底搞通服务发现的原理和实现
- Happens-Before原则深入解读
- Pinduoduo gets search term recommendation API
猜你喜欢

A unified label space for entity relationship extraction
![[MySql]substr用法-查询表的某个字段的具体位数的值](/img/d5/68658ff15f204dc97abfe7c9e6b354.png)
[MySql]substr用法-查询表的某个字段的具体位数的值

Content management tools, blue bookmarks are enough

A bowl of noodles in a dream

Thoroughly understand the principle and implementation of service discovery

Golang version management GVM

从手动测试,到自动化测试老司机,只用了几个月,我的薪资翻了一倍

Basic operation of (C language) files

深入源码剖析String类为什么不可变?(还不明白就来打我)

Vi和Vim文本编辑器
随机推荐
仅需一个依赖给Swagger换上新皮肤,既简单又炫酷
45、实例分割的labelme数据集转coco数据集以及coco数据集转labelme数据集
Supplement - nonlinear programming
逻辑漏洞----任意账号注册
Samsung releases 108million pixel image sensor isocell bright HMX, and Xiaomi will launch
Solution to the problem of sticking and unpacking TCP
Happens-Before原则深入解读
Kalibr calibration realsensed435i -- multi camera calibration
Vb.net chart1 processing
ansible安装及使用
Object. getOwnPropertyNames() VS Object.keys()
Shangtang technology releases sensepass pro, an all-in-one face recognition machine
Isilon 的OneFs常见操作命令(一)
【Flutter -- GetX】弹框 - Dialog、Snackbar、BottomSheet
LDAP -- realize unified login management of users
Vi和Vim文本编辑器
Go----Go语言中的变量使用方法
VI and VIM text editors
我的sql没问题为什么还是这么慢|MySQL加锁规则
Method overloading and method rewriting