1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        ResponseDetective非侵入式框架

        聯(lián)合創(chuàng)作 · 2023-09-27 09:21

        ResponseDetective 是一個(gè)非侵入式框架,用于攔截你的應(yīng)用程序和服務(wù)器之間的傳出請(qǐng)求和傳入的反應(yīng),可用于調(diào)試。

        使用:

        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()
        瀏覽 22
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評(píng)論
        圖片
        表情
        推薦
        點(diǎn)贊
        評(píng)論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            啊灬啊别停灬用力军婚 | 亚洲AV无码乱码国产精品黑人 | 靠逼视频在线观看免费 | 五月婷婷激情 | 91丨九色丨蝌蚪最新地址 | 北条麻妃无码播放 | 日本老女人操逼视频 | 图书室里娇喘的短裙白丝校花视频 | 加勒比一本色道久久综合亚洲精品 | 亚洲妇女下面毛茸茸 |