restful接口的幾點(diǎn)說明
??? 1)url后面添加參數(shù),可以直接通過&符號鏈接起來
例如:http://192.168.18.84/axis-cgi/com/ptz.cgi?camera=1&query=position
也可以通過Params的鍵值對進(jìn)行填充
??? 2)認(rèn)證可以通過Authorization進(jìn)行添加,根據(jù)適當(dāng)?shù)腡ype類型進(jìn)行選擇,也可以通過Header進(jìn)行認(rèn)證換算后填充,例如
Authorization: cm9vdDpyb290
??? 3)Postman指定了Connection: keep-alive屬性,因此需要服務(wù)器端主動(dòng)斷開鏈接,否則會出現(xiàn)如下的問題: 一直提示Canceling Request,即使是收到了回復(fù)
??? 4)使用https進(jìn)行請求的時(shí)候,如果返回異常,如下:
Could not get any response
There was an error connecting to https://192.168.58.42:8080/cs/restfull/operationRestfullApi/excuteSqlByCode.
Why this might have happened:
The server couldn't send a response:
Ensure that the backend is working properly
Self-signed SSL certificates are being blocked:
Fix this by turning off 'SSL certificate verification' in Settings > General
Proxy configured incorrectly
Ensure that proxy is configured correctly in Settings > Proxy
Request timeout:
Change request timeout in Settings > General
解決方案: 打開settings界面,找到General界面,然后關(guān)閉SSL certificate verification即可,是不需要認(rèn)證證書
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。