非侵入式框架 ResponseDetective

码农软件 · 软件分类 · 网络(Networking) · 2019-07-10 12:14:03

软件介绍

ResponseDetective 是一个非侵入式框架,用于拦截你的应用程序和服务器之间的传出请求和传入的反应,可用于调试。

使用:

Step 1: Register interceptors

// request
InterceptingProtocol.registerRequestInterceptor(BaseInterceptor())
InterceptingProtocol.registerRequestInterceptor(JSONInterceptor())
// response
InterceptingProtocol.registerResponseInterceptor(BaseInterceptor())
InterceptingProtocol.registerResponseInterceptor(JSONInterceptor())
InterceptingProtocol.registerResponseInterceptor(HTMLInterceptor())
// error
InterceptingProtocol.registerErrorInterceptor(BaseInterceptor())

Step 2: Register the protocol

let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
configuration.protocolClasses = [InterceptingProtocol.self]
let session = NSURLSession(configuration: configuration)
let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
configuration.protocolClasses = [InterceptingProtocol.self]
let manager = Alamofire.Manager(configuration: configuration)

Step 3: Profit

let request = NSURLRequest(URL: NSURL(string: "http://httpbin.org/get")!)
let task = session.dataTaskWithRequest(request)
task.resume()

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

Python高效开发实战——Django、Tornado、Flask、Twisted(第2版)

Python高效开发实战——Django、Tornado、Flask、Twisted(第2版)

刘长龙 / 电子工业出版社 / 2019-1 / 99

也许你听说过全栈工程师,他们善于设计系统架构,精通数据库建模、通用网络协议、后端并发处理、前端界面设计,在学术研究或工程项目上能独当一面。通过对Python 3及相关Web框架的学习和实践,你就可以成为这样的全能型人才。 《Python高效开发实战——Django、Tornado、Flask、Twisted(第2版)》分为3篇:上篇是Python基础,带领初学者实践Python开发环境,掌握......一起来看看 《Python高效开发实战——Django、Tornado、Flask、Twisted(第2版)》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具