Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Resource ../RuleMgt/Rule-Keywords.robot |
| 5 | |
| 6 | *** Keywords *** |
| 7 | httpPut |
| 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} |
GuangrongFu | 8db29f8 | 2018-12-07 17:14:15 +0800 | [diff] [blame] | 12 | ${putResponse} put request microservices ${restUrl} ${data} ${headers} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 13 | log ${putResponse} |
| 14 | [Return] ${putResponse} |
| 15 | |
| 16 | httpGet |
| 17 | [Arguments] ${restHost} ${restUrl} |
| 18 | create session microservices ${restHost} |
| 19 | ${getResponse} get request microservices ${restUrl} |
| 20 | [Return] ${getResponse} |
| 21 | |
| 22 | httpPost |
| 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 | |
| 31 | httpDelete |
| 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} |