消息关闭
    暂无新消息!

python发送 post 请求问题

问题作者 : 乖乖仔2017-07-06发布
APP抓包时候的head 和body 但是总是不返回信息,高手帮忙看看
url :https://amdc.m.taobao.com/amdc/mobileDispatch
header:
POST /amdc/mobileDispatch HTTP/1.1
Host: amdc.m.taobao.com
Accept: */*
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive
Proxy-Connection: keep-alive
Cookie: _w_tb_nick=venus892130; imewweoriw=36wAbTTfzxGDQWA26%2FAIRjgAIGdlMiANenah%2F8Y%2Byfc%3D; ockeqeudmj=p4n6QJw%3D; ti=201200%40fleamarket_iphone_5.8.6; WAPFDFDTGFG=%2B4cMKKP%2B8PI%2BKgLVFHJUoLJhKAAaAg%3D%3D; _cc_=VT5L2FSpdA%3D%3D; _l_g_=Ug%3D%3D; _m_h5_tk=3701df291eef2fde7e503f1df91e7dae_1499249727049; _m_h5_tk_enc=2c714e52c08d526b7abcf1221c275c9b; _nk_=venus892130; _tb_token_=uOr4H19KsWT6L53; cna=H3utEcBHIhECAXt0j5eaJz4m; cookie2=148db3e4d7ee92a9f9f04951eb446dce; isg=At3d6EKLWChR0Tx2gnOUKiMh5r3X-hFMFhmhbJ-iGTRjVv2IZ0ohHKtGwHAu; l=ApCQTCb-yk3xoupl2x/VZ7qZYMXiWXSj; lgc=venus892130; munb=307052057; sg=07e; skt=a1c19f616e3e2639; t=d955dd8676afe6b70311c2f5042bc92f; tracknick=venus892130; uc1=cookie21=VFC%2FuZ9ajCbF99I65Qm9gQ%3D%3D&cookie15=VT5L2FSpMGV7TQ%3D%3D&cookie14=UoW%2BsWhBNFePkw%3D%3D; uc3=vt3=F8dBzWEZIiCTc1U0c1w%3D&id2=UNDTwo1tIsRW&nk2=FbKIsTOghzpmoQg%3D&lg2=WqG3DMC9VAQiUQ%3D%3D&sg2=W5w3MJ0CrLF3l4gKbbSsatzABIJP6p9mLdxW9Mgt96c%3D; unb=307052057; uss=Vvj6QFGC5N%2FuGNyn6IHhYFfLYta9w3di2a%2Flg%2BIxCva9n94s2Cjy8vco
Accept-Language: en-us
User-Agent: %E9%97%B2%E9%B1%BC/294732 CFNetwork/711.0.6 Darwin/14.0.0
Accept-Encoding: gzip, deflate
Content-Length: 340


body:appkey=12431167&domain=restapi.amap.com&sid=&appName=FleaMarket&appVersion=5.8.6&bssid=TP-LINK_6F5E-e4%3Ad3%3A32%3Ae8%3A6f%3A5e&deviceId=WM4Sjq3mCa4DABLhHrs0A%2B%2FH&machine=iphoneos&netType=WiFi&platform=iphone&platformVersion=8.0.2&lat=&lng=&t=1499353671855&v=3.1&cv=0&carrier=wifi&simOp=wifi&sign=2057faa9cf815ce2be506252e48c1cbcc5c8092e

# coding:utf-8
import base64
import requests
url="https://amdc.m.taobao.com/amdc/mobileDispatch"
headers={"Accept": "*/*",
"Content-Type": "application/x-www-form-urlencoded",
"Connection": "keep-alive",
"Proxy-Connection":"keep-alive",
"Cookie":"__w_tb_nick=venus892130; imewweoriw=36wAbTTfzxGDQWA26%2FAIRjgAIGdlMiANenah%2F8Y%2Byfc%3D; ockeqeudmj=p4n6QJw%3D; ti=201200%40fleamarket_iphone_5.8.6; WAPFDFDTGFG=%2B4cMKKP%2B8PI%2BKgLVFHJUoLJhKAAaAg%3D%3D; _cc_=VT5L2FSpdA%3D%3D; _l_g_=Ug%3D%3D; _m_h5_tk=3701df291eef2fde7e503f1df91e7dae_1499249727049; _m_h5_tk_enc=2c714e52c08d526b7abcf1221c275c9b; _nk_=venus892130; _tb_token_=uOr4H19KsWT6L53; cna=H3utEcBHIhECAXt0j5eaJz4m; cookie2=148db3e4d7ee92a9f9f04951eb446dce; isg=At3d6EKLWChR0Tx2gnOUKiMh5r3X-hFMFhmhbJ-iGTRjVv2IZ0ohHKtGwHAu; l=ApCQTCb-yk3xoupl2x/VZ7qZYMXiWXSj; lgc=venus892130; munb=307052057; sg=07e; skt=a1c19f616e3e2639; t=d955dd8676afe6b70311c2f5042bc92f; tracknick=venus892130; uc1=cookie21=VFC%2FuZ9ajCbF99I65Qm9gQ%3D%3D&cookie15=VT5L2FSpMGV7TQ%3D%3D&cookie14=UoW%2BsWhBNFePkw%3D%3D; uc3=vt3=F8dBzWEZIiCTc1U0c1w%3D&id2=UNDTwo1tIsRW&nk2=FbKIsTOghzpmoQg%3D&lg2=WqG3DMC9VAQiUQ%3D%3D&sg2=W5w3MJ0CrLF3l4gKbbSsatzABIJP6p9mLdxW9Mgt96c%3D; unb=307052057; uss=Vvj6QFGC5N%2FuGNyn6IHhYFfLYta9w3di2a%2Flg%2BIxCva9n94s2Cjy8vco",
"Accept-Language": "en-us",
"User-Agent":"%E9%97%B2%E9%B1%BC/294732 CFNetwork/711.0.6 Darwin/14.0.0",
"Accept-Encoding": "gzip, deflate",
"Content-Length": "340"
}

formdata={"appkey":12431167,
          "domain":"restapi.amap.com",
          "sid":"",
          "appName":"FleaMarket",
          "appVersion":"5.8.6",
          "bssid":"TP-LINK_6F5E-e4%3Ad3%3A32%3Ae8%3A6f%3A5e",
          "deviceId":"WM4Sjq3mCa4DABLhHrs0A%2B%2FH",
          "machine":"iphoneos",
         "netType":"WiFi",
          "platform":"iphone",
          "platformVersion":"8.0.2",
           "lat":"",
          "lng":"",
           "t":"1499353671855",
            "v":3.1,
             "cv":0,
             "carrier":"wifi",
              "simOp":"wifi",
               "sign":"2057faa9cf815ce2be506252e48c1cbcc5c8092e"}

r=requests.post(url,json=formdata,headers=headers,verify=False)
print r.status_code
print base64.decodestring(r.text)


显示的结果
status_code:
200

Process finished with exit code 0

0个回答

暂无回答!