八十、快速将请求头header转为json格式----feapder
背景:
我们在做接口测试的时候往往需要用到header,但是postman不能直接复制为json格式,这就有点浪费时间,本篇文章给大家推荐一个工具feapder
文档参考:https://www.jianshu.com/p/eb680cc5a3d6
一、安装
pip3 install feapder
如果安装失败请参考:
解决办法:安装 Microsoft Visual C++ 工具,工具下载地址: https://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe
二、使用方法
> feapder create -j
请输入需要转换的内容: (xxx:xxx格式,支持多行)
复制这一堆:
Accept: application/json
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Cache-Control: no-cache
Connection: keep-alive
Cookie: sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%221815ba993fffa1-03e7a1bd70916e-26021b51-921600-1815ba99400d5c%22%2C%22first_id%22%3A%22%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E8%87%AA%E7%84%B6%E6%90%9C%E7%B4%A2%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC%22%2C%22%24latest_referrer%22%3A%22https%3A%2F%2Fwww.baidu.com%2Flink%22%7D%2C%22%24device_id%22%3A%221815ba993fffa1-03e7a1bd70916e-26021b51-921600-1815ba99400d5c%22%7D; _ga=GA1.2.1186034717.1655100249; UM_distinctid=18233797650459-02161631f4f6de-26021a51-e1000-1823379765114d1; acw_tc=0bcd4cde16614957505306427e013658f505caa3b3fa161124d9eb3ae4cb59; acw_sc__v2=630869c699aca9efb3a7cbe7ab2f42aeb340b6f5; signin_redirect=https://www.jianshu.com/p/eb680cc5a3d6; Hm_lvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1659491943,1659941938,1660877459,1661495751; Hm_lpvt_0c0e9d9b1e7d617b3e6842e85b9fb068=1661495751; locale=zh-CN; _gid=GA1.2.1395323424.1661495752; CNZZDATA1279807957=1894482402-1658718968-https%253A%252F%252Fwww.jianshu.com%252F%7C1661494076; _m7e_session_core=a6f069a9338f920e7665a0a8e6d1156a; Hm_lvt_1c6cd6a9fd5f687d8040b44bebe5d395=1659491944,1659941939,1660877461,1661495753; Hm_lpvt_1c6cd6a9fd5f687d8040b44bebe5d395=1661495753; ssxmod_itna=YqGOGKAKBK7IKeqD5GH5YP4jrqNGCnFY9F/A+RDBq3h4iNDnD8x7YDvAINmYA3KmGGmPfe9YuGzfFWipmxPOWmG3s7DCPGnDBFwxWfDYAkDt4DTD34DYDixibCxi5GRD0KDFF5XUZ9Dm4GW9qDgn4GgDCiD0+Uc3wiD4qDB+rdDKM0cDGY6YmUdpLh=hD+cD0UqxBLeWpGcICcFoiX=56nDaEQDzkHDtut5wMbDC2=/Ud0stiPeA05pAYxF+i+NtGGKnBGQFi+bd1D=lg4tUYAeBKwLzKDA80vLeD===; ssxmod_itna2=YqGOGKAKBK7IKeqD5GH5YP4jrqNGCnFY9F/A+D8d=gDGXK6eGaGFKIk1h/f2k9oOFNYq9179+OX3BwGRNUKGTo0YcYWdxjjiR4CD=hzB+=vW2unYaEioUtGuT6Azvc7gUjnfvPOVCRToC+bwOARP80g=gKRpUb8vORS=YICIyGCw5LEIce4E0GgUqo7WlD+KlKYPDKuWDFqD2YiD
Host: www.jianshu.com
Pragma: no-cache
Referer: https://www.jianshu.com/p/eb680cc5a3d6
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
sec-ch-ua: "Chromium";v="104", " Not A;Brand";v="99", "Google Chrome";v="104"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
这一堆就是转换成功的结果