MarketSquare / MarketSquare/robotframework-requests
'put request' failed with octet-stream file
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 512
- Forks
- 283
- PR merge metrics
- No merged PRs in 30d
Description
Put Request failed with sending octet-stream file, for example:
Create Session | ${session_name} | http://upload.mytestaddress.com/upload | timeout=60 | max_retries=0
${file_data} | Get Binary File | D:\\\\DSC_6613.jpg
${LocalHeader} | Create Dictionary | Content-type=application/octet-stream
${response}= | Put Request | ${session_name} | /System/deviceInfo | ${file_data} | headers=${LocalHeader}
which will get error:
FAIL : UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte
btw, if using Put keyword instead of Put Request, it won't get error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example using Get Binary File, Create Dictionary, and Put Request, then compare its handling with the Put keyword, which does not fail. Trace the Put Request and Put entry points to find where octet-stream bytes are decoded, and consider the issue done when binary data completes without the UnicodeDecodeError and the two keyword paths behave consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100