如何在使用 RestClient 测试 Rest API 时传递 --data "{'myuid':'testuser1'}"

How to pass --data "{'myuid':'testuser1'}" while testing Rest API with the RestClient

我正在 RestClient 中测试以下 API 但我没有收到响应,因为我不知道如何传递 --data "{'myuid':'testuser1' }".

curl -k -v -c cookies.txt -b cookies.txt 
     -X POST 
     -H "Content-Type:application/json" -H "Accept: application/json"
     --data "{'myuid':'testuser1'}"
     "https://<isam address>/mgaapi/sps/apiauthsvc?PolicyId=urn:ibm:security:authentication:asf:mytotp"

我也附上了截图。

我应该如何在 RestClient 中正确传递 --data "{'myuid':'testuser1'}" 以获得服务器的响应?

RestAPI Testing

用很少的(正确且必需的)格式试试这个:

curl -k -v -c cookies.txt -b cookies.txt 
     -X POST
     -H "Content-Type:application/json" 
     -H "Accept: application/json"
     --data '{"myuid":"testuser1"}'
     https://<aa>/mgaapi/sps/apiauthsvc?PolicyId=urn:ibm:security:authentication:asf:mytotp

格式是这样的: curl -X POST -H "Content-Type: application/json" -d '{"key":"val"}' URL