{"action":"created","issue":{"url":"https://api.github.com/repos/taverntesting/tavern/issues/24","repository_url":"https://api.github.com/repos/taverntesting/tavern","labels_url":"https://api.github.com/repos/taverntesting/tavern/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/taverntesting/tavern/issues/24/comments","events_url":"https://api.github.com/repos/taverntesting/tavern/issues/24/events","html_url":"https://github.com/taverntesting/tavern/issues/24","id":294927765,"number":24,"title":"Getting requests.exceptions.InvalidHeader:","user":{"login":"sridharaiyer","id":5684178,"avatar_url":"https://avatars1.githubusercontent.com/u/5684178?v=4","gravatar_id":"","url":"https://api.github.com/users/sridharaiyer","html_url":"https://github.com/sridharaiyer","followers_url":"https://api.github.com/users/sridharaiyer/followers","following_url":"https://api.github.com/users/sridharaiyer/following{/other_user}","gists_url":"https://api.github.com/users/sridharaiyer/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharaiyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharaiyer/subscriptions","organizations_url":"https://api.github.com/users/sridharaiyer/orgs","repos_url":"https://api.github.com/users/sridharaiyer/repos","events_url":"https://api.github.com/users/sridharaiyer/events{/privacy}","received_events_url":"https://api.github.com/users/sridharaiyer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-06T21:58:48Z","updated_at":"2018-02-07T17:22:38Z","closed_at":"2018-02-07T12:01:13Z","author_association":"NONE","body":"In my test.tavern.yaml file\r\n\r\n```\r\n  - name: Make sure signature is returned\r\n    request:\r\n      url: \"{signature_url:s}\"\r\n      method: PUT\r\n      headers:\r\n        content-type: application/json\r\n        content: {\"ppddCode\": \"11\",\"LIN\": \"123456789\",\"correlationID\":\"{correlationId:s}\",\"bodyTypeCode\":\"utv\"}\r\n        token: \"{sessionToken:s}\"\r\n    response:\r\n      status_code: 200\r\n      save:\r\n        body:\r\n          signature: signature\r\n```\r\nI get the following error response:\r\n\r\n```\r\nE           requests.exceptions.InvalidHeader: Value for header {content: {'ppddCode': '11', 'LIN': '123456789', 'correlationID': '99019c36-4f49-4be8-815c-9ff5cbcc14ff', 'bodyTypeCode': 'utv'}} must be of type str or bytes, not <class 'dict'>\r\n\r\nvenv/lib/python3.6/site-packages/requests/utils.py:872: InvalidHeader\r\n```\r\nHow to convert my 'content' in my header to a dict? Or any other solution?"},"comment":{"url":"https://api.github.com/repos/taverntesting/tavern/issues/comments/363843873","html_url":"https://github.com/taverntesting/tavern/issues/24#issuecomment-363843873","issue_url":"https://api.github.com/repos/taverntesting/tavern/issues/24","id":363843873,"user":{"login":"sridharaiyer","id":5684178,"avatar_url":"https://avatars1.githubusercontent.com/u/5684178?v=4","gravatar_id":"","url":"https://api.github.com/users/sridharaiyer","html_url":"https://github.com/sridharaiyer","followers_url":"https://api.github.com/users/sridharaiyer/followers","following_url":"https://api.github.com/users/sridharaiyer/following{/other_user}","gists_url":"https://api.github.com/users/sridharaiyer/gists{/gist_id}","starred_url":"https://api.github.com/users/sridharaiyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sridharaiyer/subscriptions","organizations_url":"https://api.github.com/users/sridharaiyer/orgs","repos_url":"https://api.github.com/users/sridharaiyer/repos","events_url":"https://api.github.com/users/sridharaiyer/events{/privacy}","received_events_url":"https://api.github.com/users/sridharaiyer/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T17:22:38Z","updated_at":"2018-02-07T17:22:38Z","author_association":"NONE","body":"Could you please suggest any other workarounds to handle a JSON block inside YAML? I tried the workaround suggested on this thread but it didn't help. https://stackoverflow.com/questions/9532840/embedding-json-data-into-yaml-file\r\n\r\nIf we are not able to find a solution for handling JSON in YAML in general or in the request header as in this case for Tavern to work, then I am afraidI may have to switch back to writing my own boiler plate using the Requests package and not proceed ahead with using Tavern."}}
{"actor":{"display_login":"sridharaiyer"}}