Using middleware and browser Combination

12 views
Skip to first unread message

Subhabrata Pal

unread,
Feb 16, 2018, 11:51:49 AM2/16/18
to hoverfly

Hi,

When we run the middleware and command prompt (using cURL) all works fine

To execute thru browser for URL (http://time.jsontest.com/) - 
Based on suggestion I added both content Length and Content Type but adding following lines gives exception in the middleware scripts

payload_dict['response']['headers']['Content-Type'] = "application/json; charset=ISO-8859-1"
payload_dict['response']['headers']['Content-Length'] = [str(len(json.dumps(payload_dict))]


I am not so good in Python script.

Is this steps of code correct or there is some other way or Additional steps are needed?

Thanks for any help

Regards
Subhabrata
middleware.py
Reply all
Reply to author
Forward
0 new messages