使用Robot Framework和python使用Rest Api HTTPS POST请求上传PDF文件

时间:2020-08-11 17:50:24

标签: api rest upload robotframework

${file}    Get File For Streaming Upload    
${CURDIR}${/}TestData${/}payment.pdf

&{headers}    Create Dictionary    Authorization=Bearer ${accessToken} 

&{uploadBody}    Create Dictionary    file=${file}

${response}    Post Request    **fileuplaod/documentt/put?userId=kumar&fileName=payment.pdf&docClass=OTL_WI_CLASS&orgId=HKHSBC&docClassType=fileItem**   headers=${headers}    files=${uploadBody}

      
${Response}    Get Json Data    ${response}          ---(to read  response json file)

我正在使用以上代码上传pdf文件..但每次给出{'status':'FAILURE'}

0 个答案:

没有答案