How to upload image file using request library post request?

1,132 views
Skip to first unread message

Ramakrishna kolli

unread,
Mar 11, 2015, 10:02:42 AM3/11/15
to robotframe...@googlegroups.com
Hi All,

How to upload image file using request library post request
Thanks 
Ram

Ramakrishna kolli

unread,
Mar 12, 2015, 4:33:45 PM3/12/15
to robotframe...@googlegroups.com
Any one help me , im getting error like "ValueError: Data must not be a string".

The  test case is 
    Create Session    Baseurl    ${BaseURL}
    ${file_data}=    Get Binary File    ${CURDIR}${/}image.jpg
    ${files}=    Create Dictionary    file    ${file_data}
    ${data}    Create Dictionary    FriendlyName    imagecreated 
    ${HEADERS}    Create Dictionary    Content-Type    application/x-www-form-urlencoded
    ${resp}=    Post Request    Baseurl    /api/v1/projectFiles    data=${data}    headers=${HEADERS}    files=${files}

Anil Shrestha

unread,
Apr 4, 2019, 7:04:23 AM4/4/19
to robotframework-users
Anyone can help , how to upload photo using post request in robotframework?
Reply all
Reply to author
Forward
0 new messages