pleng
1 min readNov 15, 2019

Robot Framework with RequestsLibrary

### GET with pass parameter###

*** Settings ***
Library RequestsLibrary
*** Variables ***
${API_URL} localhost:80
*** Test Cases ***
Call GetData
Create Session API ${API_URL}
${resp}= Get Request API /Parameter
Log ${resp.text}
Should Contain ${resp.text} "Response"

### POST with pass json Body###

*** Settings ***
Library RequestsLibrary
*** Variables ***
${API_URL} localhost:80
*** Test Cases ***
Call CreateUpdatePlace
Create Session API ${API_URL}
${data}= To Json {"para1":"test"}
${headers}= Create Dictionary Content-Type=application/json
${resp}= POST Request API /path json=${data} headers=${headers}
Should Contain ${resp.text} {"message":"success"}

Keywords Document