Adding POST method for JSONs to Utils.robot 38/28938/1
authorTomas Cechvala <tcechval@cisco.com>
Thu, 29 Oct 2015 11:19:53 +0000 (12:19 +0100)
committerTomas Cechvala <tcechval@cisco.com>
Thu, 29 Oct 2015 11:19:53 +0000 (12:19 +0100)
For cases when we don't want to read JSONs from file
but from variable.

Change-Id: I99290db17bb65bc927fb9de9711be3a834a8bb30
Signed-off-by: Tomas Cechvala <tcechval@cisco.com>
csit/libraries/Utils.robot

index 89603cbc400055a44f17813d36f21f4cfa550e20..db3546d1e5fcbf476771230553a88622c13c1cce 100644 (file)
@@ -283,6 +283,12 @@ Concatenate the String
     ${output}=    Catenate    ${str1}    ${str2}
     [Return]    ${output}
 
+Post Elements To URI
+    [Arguments]    ${rest_uri}    ${data}
+    [Documentation]    Perform a POST rest operation, using the URL and data provided
+    ${resp} =    RequestsLibrary.Post Request    session    ${rest_uri}    data=${data}    headers=${headers}
+    Should Be Equal As Strings    ${resp.status_code}    200
+
 Remove All Elements At URI
     [Arguments]    ${uri}
     ${resp}    RequestsLibrary.Delete    session    ${uri}