Unable to parse data when I try to POST to Elasticsearch

page='ABCD'
header='{"content":"'
footer='", "my-join-field":{"name": "my_page","parent": "1"}}'

!curl -X POST "localhost:9200/docpage/_doc/?refresh&pretty" -H 'Content-Type: application/json' -d"$header$page$footer"

I can run this command successfully in bash. But when I try to run it in a jupyter notebook, I get an error...
"type" : "mapper_parsing_exception",
"reason" : "failed to parse",
"caused_by" : {
"type" : "json_parse_exception",
"reason" : "Unexpected character ('c' (code 99)): was expecting double-quote to start field name\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@72df2b92; line: 1, column: 3]"
}