{"id":29799707,"url":"https://github.com/xiaohange/jqhttprequest","last_synced_at":"2025-07-28T08:11:07.221Z","repository":{"id":56916365,"uuid":"92267070","full_name":"xiaohange/JQHttpRequest","owner":"xiaohange","description":"GET／POST / PUT / DELETE 网络请求的封装","archived":false,"fork":false,"pushed_at":"2017-08-16T02:26:01.000Z","size":509,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T06:53:41.057Z","etag":null,"topics":["api-client","delete","get","head","http-client","patch","post","put","request"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaohange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-24T08:09:46.000Z","updated_at":"2018-03-09T02:32:06.000Z","dependencies_parsed_at":"2022-08-21T03:50:38.948Z","dependency_job_id":null,"html_url":"https://github.com/xiaohange/JQHttpRequest","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/xiaohange/JQHttpRequest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohange%2FJQHttpRequest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohange%2FJQHttpRequest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohange%2FJQHttpRequest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohange%2FJQHttpRequest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaohange","download_url":"https://codeload.github.com/xiaohange/JQHttpRequest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaohange%2FJQHttpRequest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267482004,"owners_count":24094508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","delete","get","head","http-client","patch","post","put","request"],"created_at":"2025-07-28T08:10:28.920Z","updated_at":"2025-07-28T08:11:07.209Z","avatar_url":"https://github.com/xiaohange.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JQHttpRequest\n前言\n===\n JQHttpRequest:目前二次封装网络库支持四种请求：GET、POST、PUT、DELETE较常见的请求，HEAD/PATH/COPY/OPTIONS/LINK/LOCK等不常用的后续会根据需求调整,本库支持数据缓存、缓存超时设置、请求超时设置等;支持cer证书验证等;\n\n## 更新记录\n\n- 0.0.5\n新增文件上传, 文件下载, 设置请求头等\n- 0.0.4 \n新增取消全部请求\n- 0.0.3\n新增CER证书验证\n- 0.0.2\n新增EGOCache缓存, 新增四种缓存方式\n- 0.0.1 \n发布第一版本 0.0.1\n \n## Installation\n\n#### From CocoaPods\n\n```\npod  \"JQHttpRequest\"\n```\n\n#### Manually \n- Drag all source files under floder `JQHttpRequest` to your project.\n\n## Usage\n```\n///Test\n    [[JQBaseRequest sharedManager].setRequest(COLLECTION_LIST).RequestType(JQRequestMethodGET).Cachetype(JQBaseRequestReloadIgnoringLocalCacheData).cerName(nil).timeoutInterval(30).CachTime(60).Parameters(nil) startRequestWithSuccess:^(NSURLSessionDataTask *task, id responseObject) {\n        \n    } progress:^(NSProgress *progress) {\n        \n    /* NSProgress 不能为nil，因为AFN的默认参数是 _Nonnull 修饰的！*/\n        \n    } failure:^(NSURLSessionDataTask *task, NSError *error) {\n        NSLog(@\"%@\",error);\n    }];\n\n```\n- 参数说明：\n\n```\nsetRequest:  请求url\nRequestType: \n             请求类型：\n             JQRequestMethodGET = 0,\n             JQRequestMethodPOST,\n             JQRequestMethodPUT,\n             JQRequestMethodDELETE 目前支持四种,会持续更新;\n-------------------------------------------------------------------------\nCachetype: 缓存类型：\nJQBaseRequestReturnCacheDataThenLoad = 0,  ///\u003c 有缓存就先返回缓存，同步请求数据\nJQBaseRequestReloadIgnoringLocalCacheData, ///\u003c 忽略缓存，重新请求\nJQBaseRequestReturnCacheDataElseLoad,      ///\u003c 有缓存就用缓存，没有缓存就重新请求(用于数据不变时)\nJQBaseRequestReturnCacheDataDontLoad,      ///\u003c 有缓存就用缓存，没有缓存就不发请求，当做请求出错处理（用于离线模式）\n\ncerName: cer证书名称,设置则开启验证,默认不开启,若设置请确保名称正确，否则导致crash;\n\ntimeoutInterval: 请求超时设置 默认20s\nCachTime:        设置缓存时间 默认时间一天\nParameters:      参数设置 字典传输\n\n          \n```\n- startRequestWithSuccess: 请求函数，提供三个,如下：\n\n```\n/**\n *  发送请求\n *\n *  @param Success  成功的回调\n *  @param Progress 进度的回调\n *  @param Fail     请求错误的回调\n */\n- (void)startRequestWithSuccess:(JQResponseSuccess)Success progress:(JQProgress)Progress failure:(JQResponseFail)Fail;\n/**\n *  上传文件\n *\n *  @param Success  成功的回调\n *  @param Progress 进度的回调\n *  @param Fail     请求错误的\n */\n- (void)uploadfileWithSuccess:(JQResponseSuccess)Success progress:(JQProgress)Progress failure:(JQResponseFail)Fail;\n/**\n *  下载文件\n *\n *  @param Success  成功的回调\n *  @param Progress 进度的回调\n *  @param Fail     请求错误的\n *  @return 返回NSURLSessionDownloadTask实例，可用于暂停继续，暂停调用suspend方法，重新开启下载调用resume方法\n */\n- (NSURLSessionDownloadTask *)downloadWithSuccess:(JQFileSuccess)Success progress:(JQProgress)Progress failure:(JQResponseFail)Fail;\n```\n## Note\n\n![](https://github.com/xiaohange/JQHttpRequest/blob/master/fail.png?raw=true)\n\n`progress:^(NSProgress *progress)`不能为nil，因为AFN的默认参数是 _Nonnull 修饰的！\n\n- 正确姿势：\n\n![](https://github.com/xiaohange/JQHttpRequest/blob/master/success.png?raw=true)\n\n\n## Other\n[JQTumblrHud-高仿Tumblr App 加载指示器hud](https://github.com/xiaohange/JQTumblrHud)\n\n[JQScrollNumberLabel：仿tumblr热度滚动数字条数](https://github.com/xiaohange/JQScrollNumberLabel)\n\n[TumblrLikeAnimView-仿Tumblr点赞动画效果](https://github.com/xiaohange/TumblrLikeAnimView)\n\n[JQMenuPopView-仿Tumblr弹出视图发音频、视频、图片、文字的视图](https://github.com/xiaohange/JQMenuPopView)\n\n## Star\n\n[CSDN博客](http://blog.csdn.net/qq_31810357)    \n\niOS开发者交流群：①群:446310206 ②群:426087546 喜欢就❤️❤️❤️star一下吧！ \n\nLove is every every every star! Your support is my renewed motivation!\n\n## License\n\nThis code is distributed under the terms and conditions of the [MIT license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaohange%2Fjqhttprequest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaohange%2Fjqhttprequest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaohange%2Fjqhttprequest/lists"}