apiembed icon indicating copy to clipboard operation
apiembed copied to clipboard

Literals in JSON text body are invalid

Open Miserlou opened this issue 7 years ago • 0 comments

For some reason, this is okay (notice the prefer_sms field):

{"cookies": [], "postData": {"mimeType": "application/json", "text": "{\"foo\": \"bar\", \"name\": \"Will Gates\", \"prefer_sms\": \"false\"}"}, "url": "http://mockbin.com/request", "queryString": [], "headers": [{"name": "Accept", "value": "application/json"}, {"name": "Content-Type", "value": "application/json"}], "method": "POST", "httpVersion": "HTTP/1.1"}

But this isn't:

{"cookies": [], "postData": {"mimeType": "application/json", "text": "{\"foo\": \"bar\", \"name\": \"Will Gates\", \"prefer_sms\": false}"}, "url": "http://mockbin.com/request", "queryString": [], "headers": [{"name": "Accept", "value": "application/json"}, {"name": "Content-Type", "value": "application/json"}], "method": "POST", "httpVersion": "HTTP/1.1"}

Even though both are valid JSON. Not sure what to do about this.

Miserlou avatar Feb 06 '17 19:02 Miserlou