I am using the requests library in Robot framework provided at this github link. The documentation implies that if can send custom headers by doing CreateSession <
According to the Requests documentation, you may add headers to the Session object as:
s = requests.Session()
s.auth = ('user', 'pass')
s.headers.update({'x-test': 'true'})
You aren't passing a dictionary, you're passing a string that looks like a dictionary. The solution is to create a proper dictionary and pass that in. Robot has a Create Dictionary keyword for this purpose.
*** Settings ***
| Library | Collections
*** Test Cases ***
| Example
| | ${headers}= | Create dictionary
| | ... | header1 | value1
| | ... | header2 | value2
| | CreateSession | SendCustomHeader | http://myhost.com
| | ... | header=${headers} | verify=False