我想使用 HTTPie 查詢 REST API。我通常用 curl 來這樣做,我可以用它來指定maxKeys,startAfterFilename例如
curl --location --request GET -G \
"https://some.thing.some.where/data/v1/datasets/mydataset/versions/2/files" \
-d maxKeys=100 \
-d startAfterFilename=YYYMMDD_HHMMSS.file \
--header "Authorization: verylongtoken"
如何-d在 HTTPie 中使用這些選項?
uj5u.com熱心網友回復:
在您的情況下,命令如下所示:
http -F https://some.thing.some.where/data/v1/datasets/mydataset/versions/2/files \
Authorization:verylongtoken \
startAfterFilename=="YYYMMDD_HHMMSS.file" \
maxKeys=="100"
雖然,有很多方法可以使用httpie. 例如
http POST http://example.com/posts/3 \
Origin:example.com \ # : HTTP headers
name="John Doe" \ # = string
q=="search" \ # == URL parameters (?q=search)
age:=29 \ # := for non-strings
list:='[1,3,4]' \ # := json
[email protected] \ # @ attach file
[email protected] \ # =@ read from file (text)
user:[email protected] # :=@ read from file (json)
或者,在表格的情況下
http --form POST example.com \
name="John Smith" \
[email protected]
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/347676.html
