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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response