How to obtain the value of --data #3013
Answered
by
robjtede
zhangwuqiao
asked this question in
Q&A
-
curl -X GET -H 'token: ck-e15c4fe5-b9b5-4153-ba35-af22182592b2' \
-H 'Content-Type: text/plain' -i 'http://127.0.0.1:8080/index2' \
--data '"test":[{"a":"str","b":12},{"a":"str1","b":121},{"a":"str2","b":122}]' How to use an extractor to extract the value of “--data”? thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
robjtede
Apr 14, 2023
Replies: 1 comment 1 reply
-
It looks like you're trying to send JSON, however that snippet isn't valid JSON. Using the Alternatively, use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
robjtede
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like you're trying to send JSON, however that snippet isn't valid JSON.
Using the
Json<T>
extractor (docs) you would be able to obtain a struct with the sent data.Alternatively, use
String
orBytes
as the extractor to get the raw string or byte payload respectively.