Fix post body

The pointer to the string was being released before exiting the lambda. Switching to CURLOPT_COPYPOSTFIELDS fixed it. This copying is unnecessary, so I will follow up with another fix.