【发布时间】:2021-08-06 13:55:12
【问题描述】:
您好,我正在尝试使用正文测试 api:
{
"customerAttributes": [
{
"customerId": 0,
"id": 0,
"name": "string",
"value": "string"
}
],
"emailAddress": "string",
"firstName": "string",
"id": 0,
"lastName": "string",
"registered": true
}
由于它有多个对象,我不知道如何使它工作。这就是我目前所拥有的:
*** Settings ***
Library RequestsLibrary
*** Variables ***
${Base_URL}= http://localhost:8082 /api/v1
*** Test Cases ***
TC_004_POST_Customer
Create session customer ${Base_URL}
${body}= create dictionary customerId=100 id=100 name=test value=0 emailAdress=blabla@gmailcom firstName=algo id=101 lastName=testt registered=true
${header}= create dictionary Content-Type=application/json
${response}= Post On Session customer /customer data=${body} headers=${header}
log to console ${response.status_code}
log to console ${response.content}
有人可以帮我吗?谢谢!
【问题讨论】:
标签: java post robotframework broadleaf-commerce document-body