blob: 992db35e11d17280670e768ee620201360cdc065 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Resource ../RuleMgt/Rule-Keywords.robot
5
6*** Keywords ***
7httpPut
8 [Arguments] ${restHost} ${restUrl} ${data}
9 ${headers} create dictionary Content-Type=application/json;charset=utf-8 Accept=application/json
10 create session microservices ${restHost} ${headers}
11 log ${data}
GuangrongFu8db29f82018-12-07 17:14:15 +080012 ${putResponse} put request microservices ${restUrl} ${data} ${headers}
Gary Wu9abb61c2018-09-27 10:38:50 -070013 log ${putResponse}
14 [Return] ${putResponse}
15
16httpGet
17 [Arguments] ${restHost} ${restUrl}
18 create session microservices ${restHost}
19 ${getResponse} get request microservices ${restUrl}
20 [Return] ${getResponse}
21
22httpPost
23 [Arguments] ${restHost} ${restUrl} ${data}
24 ${headers} create dictionary Content-Type=application/json Accept=application/json
25 create session microservices ${restHost} ${headers}
26 log ${data}
27 ${postResponse} post request microservices ${restUrl} ${data}
28 Comment log ${postResponse.content}
29 [Return] ${postResponse}
30
31httpDelete
32 [Arguments] ${restHost} ${restUrl}
33 ${headers} create dictionary Content-Type=application/json Accept=application/json
34 create session microservices ${restHost} ${headers}
35 ${deleteResponse} delete request microservices ${restUrl}
36 [Return] ${deleteResponse}