网络连接库 JXHTTP

码农软件 · 软件分类 · 网络工具包 · 2019-02-26 16:12:00

软件介绍

JXHTTP 是来自 tumblr 的 iOS 和 OS X 上的网络连接库。

示例

Asynchronous

JXHTTPOperation *op = [JXHTTPOperation withURLString:@"https://encrypted.google.com/"];
op.didFinishLoadingBlock = ^(JXHTTPOperation *op) { NSLog(@"%@", op.responseString);
};

[[JXHTTPOperationQueue sharedQueue] addOperation:op];

Synchronous

JXHTTPOperation *op = [JXHTTPOperation withURLString:@"https://encrypted.google.com/"];
[op startAndWaitUntilFinished]; NSLog(@"%@", op.responseString);

Complex

NSURL *postURL = [NSURL URLWithString:@"https://web.site/api/POST"]; NSDictionary *postParams = @{ @"make": @"Ferrari", @"model": @"458 Italia" };

JXHTTPOperation *op = [[JXHTTPOperation alloc] initWithURL:postURL];
op.requestBody = [[JXHTTPFormEncodedBody alloc] initWithDictionary:postParams];
op.requestCachePolicy = NSURLRequestReloadIgnoringLocalAndRemoteCacheData;
op.responseDataFilePath = @"/tmp/downloaded_data";
op.trustedHosts = @[ postURL.host ];
op.performsBlocksOnMainQueue = YES;

op.didSendDataBlock = ^(JXHTTPOperation *op) { NSLog(@"%lld bytes uploaded so far", op.bytesUploaded);
};

[[JXHTTPOperationQueue sharedQueue] addOperation:op];

本文地址:https://codercto.com/soft/d/185.html

Beautiful Code

Beautiful Code

Greg Wilson、Andy Oram / O'Reilly Media / 2007-7-6 / GBP 35.99

In this unique work, leading computer scientists discuss how they found unusual, carefully designed solutions to difficult problems. This book lets the reader look over the shoulder of major coding an......一起来看看 《Beautiful Code》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换