国产精品,日韩av,hdsexvideos中国少妇,xxxxx性bbbbb欧美熟妇,波多野结衣乳巨码无在线,国产成人亚洲精品乱码

自定義函數(shù)-Fx.http

2020-12-26 10:38:21 1197 本站

     Fx.http:和http請求相關(guān)的API

     其中content屬性類型為String/Map,根據(jù)HTTP返回頭Content-Type中是否包含application/json來決定content類型,True是Map,F(xiàn)alse是String;

1、HTTP GET請求息-get

     定義1:Fx.http.get(String url,Map headers)

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.get("http://www.fxiaoke.com",["X-token":"myToken"])

     定義2:Fx.http.get(String url , Map headers , int timeout , boolean retry, int retryCount)

    參數(shù)說明:

參數(shù)說明
url請求地址
headers請求header
timeoutscoketTimeOut超時(shí)時(shí)間,單位ms,最大10s ,1s=1000ms
retryscoketTimeOut超時(shí)是否重試;連接超時(shí)一定會(huì)進(jìn)行重試,這個(gè)參數(shù)決定了timeout是否重試;設(shè)置為true時(shí),可能會(huì)造成重復(fù)提交
retryCount重試次數(shù),最多3次

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.get("http://www.fxiaoke.com",["X-token":"myToken"],2000,true,2)

2、HTTP POST請求-post

     定義1:Fx.http.post(String url,Map headers,Map/String data)

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.post("http://www.fxiaoke.com",["X-token":"myToken"],["id":1])

     定義2:Fx.http.post(String url , Map headers , Map/String data , int timeout , boolean retry, int retryCount)

參數(shù)說明
url請求地址
headers請求header
data請求體
timeoutscoketTimeOut超時(shí)時(shí)間,單位ms,最大10s ,1s=1000ms
retryscoketTimeOut超時(shí)是否重試;連接超時(shí)一定會(huì)進(jìn)行重試,這個(gè)參數(shù)決定了timeout是否重試;設(shè)置為true時(shí),可能會(huì)造成重復(fù)提交
retryCount重試次數(shù),最多3次

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.post("http://www.fxiaoke.com",["X-token":"myToken"],["id":1],2000,true,2)

3、HTTP PUT請求-put

     定義1:Fx.http.post(String url,Map headers,Map/String data)

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.put("http://www.fxiaoke.com",["X-token":"myToken"],["id":1])

     定義2:Fx.http.post(String url , Map headers , Map/String data , int timeout , boolean retry, int retryCount)

參數(shù)說明
url請求地址
headers請求header
data請求體
timeoutscoketTimeOut超時(shí)時(shí)間,單位ms,最大10s ,1s=1000ms
retryscoketTimeOut超時(shí)是否重試;連接超時(shí)一定會(huì)進(jìn)行重試,這個(gè)參數(shù)決定了timeout是否重試;設(shè)置為true時(shí),可能會(huì)造成重復(fù)提交
retryCount重試次數(shù),最多3次

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.post("http://www.fxiaoke.com",["X-token":"myToken"],["id":1],2000,true,2)

4、HTTP DELETE請求-delete

     定義1:Fx.http.delete(String url,Map headers,Map/String data)

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.delete("http://www.fxiaoke.com",["X-token":"myToken"],["id":1])

     定義2:Fx.http.post(String url , Map headers , Map/String data , int timeout , boolean retry, int retryCount)

參數(shù)說明
url請求地址
headers請求header
data請求體
timeoutscoketTimeOut超時(shí)時(shí)間,單位ms,最大10s ,1s=1000ms
retryscoketTimeOut超時(shí)是否重試;連接超時(shí)一定會(huì)進(jìn)行重試,這個(gè)參數(shù)決定了timeout是否重試;設(shè)置為true時(shí),可能會(huì)造成重復(fù)提交
retryCount重試次數(shù),最多3次

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.delete("http://www.fxiaoke.com",["X-token":"myToken"],["id":1],2000,true,2)

5、HTTP POST請求-patch

     定義1:Fx.http.post(String url,Map headers,Map/String data)

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.patch("http://www.fxiaoke.com",["X-token":"myToken"],["id":1])

     定義2:Fx.http.patch(String url , Map headers , Map/String data , int timeout , boolean retry, int retryCount)

參數(shù)說明
url請求地址
headers請求header
data請求體
timeoutscoketTimeOut超時(shí)時(shí)間,單位ms,最大10s ,1s=1000ms
retryscoketTimeOut超時(shí)是否重試;連接超時(shí)一定會(huì)進(jìn)行重試,這個(gè)參數(shù)決定了timeout是否重試;設(shè)置為true時(shí),可能會(huì)造成重復(fù)提交
retryCount重試次數(shù),最多3次

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.post("http://www.fxiaoke.com",["X-token":"myToken"],["id":1],2000,true,2)

6、HTTP OPTIONS請求-options

     定義1:Fx.http.options(String url,Map headers)

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.post("http://www.fxiaoke.com",["X-token":"myToken"],["id":1])

     定義2:Fx.http.options(String url , Map headers , int timeout , boolean retry, int retryCount)

參數(shù)說明
url請求地址
headers請求header
timeoutscoketTimeOut超時(shí)時(shí)間,單位ms,最大10s ,1s=1000ms
retryscoketTimeOut超時(shí)是否重試;連接超時(shí)一定會(huì)進(jìn)行重試,這個(gè)參數(shù)決定了timeout是否重試;設(shè)置為true時(shí),可能會(huì)造成重復(fù)提交
retryCount重試次數(shù),最多3次

     data返回值類型:HttpResult,屬性有:statusCode、content

     例:

def (Boolean error,HttpResult data,String errorMessage) =  Fx.http.options("http://www.fxiaoke.com",["X-token":"myToken"],2000,true,2)



部分內(nèi)容來源于互聯(lián)網(wǎng),如有侵權(quán),請聯(lián)系客服刪除處理。
在線咨詢 撥打電話