aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot
blob: 5b841740447d139bb366095a5b6932699cf45b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
*** Settings ***
Library           Collections
Library           RequestsLibrary
Resource          ../RuleMgt/Rule-Keywords.robot

*** Keywords ***
httpPut
    [Arguments]    ${restHost}    ${restUrl}    ${data}
    ${headers}    create dictionary    Content-Type=application/json;charset=utf-8    Accept=application/json
    create session    microservices    ${restHost}    ${headers}
    log    ${data}
    ${putResponse}    put request    microservices    ${restUrl}    ${data}    \    ${EMPTY}
    ...    ${headers}
    log    ${putResponse}
    [Return]    ${putResponse}

httpGet
    [Arguments]    ${restHost}    ${restUrl}
    create session    microservices    ${restHost}
    ${getResponse}    get request    microservices    ${restUrl}
    [Return]    ${getResponse}

httpPost
    [Arguments]    ${restHost}    ${restUrl}    ${data}
    ${headers}    create dictionary    Content-Type=application/json    Accept=application/json
    create session    microservices    ${restHost}    ${headers}
    log    ${data}
    ${postResponse}    post request    microservices    ${restUrl}    ${data}
    Comment    log    ${postResponse.content}
    [Return]    ${postResponse}

httpDelete
    [Arguments]    ${restHost}    ${restUrl}    ${data}
    ${headers}    create dictionary    Content-Type=application/json    Accept=application/json
    create session    microservices    ${restHost}    ${headers}
    ${deleteResponse}    delete request    microservices    ${restUrl}    ${data}
    [Return]    ${deleteResponse}