I need to capture a html content and pass it to another curl as form data.
My solution:
curl http://example.com/campaigns/create.php \
-F api_key=myKey \
-F subject="My Subject" \
-F list_ids=12345 \
-F html_text="'$(curl -s -L https://somedomain.com?feed=sports)'" &>/dev/null
Note: Yes, I have tried html_text="$(curl -s -L https://somedomain.com?feed=sports)". But server can't resolve isset($_POST['html_text']) then.
My output:
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
.....
</center> </body> </html>'
This above example works fine except html_text wrapped with an unnecessary single quote ('). Any suggestion how can get I rid of this single quote around the html_text?