How to make a POST (ReST) API in Robot framework with

前端 未结 3 1802
孤城傲影
孤城傲影 2021-01-13 09:09

I need to replicate the below API call in Robot Framework:

curl -X POST \"http://xyz/api/createApp\" -H \"Content-Type:application/json\" -d @/tmp/testfile.jso

3条回答
  •  天命终不由人
    2021-01-13 09:20

    It perfectly works when using double backslashes and quotes like:

    curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' -X POST -d "{\"target\" : \"5142221345\",\"source\" : \"432567890\",\"messages\" : [ { \"format\" : \"AMR\", \"data\" : \"binarydata...\" } ]}" http://10.4.4.11:8089/v1/voice/add

提交回复
热议问题