Cleanup of http_client fix. Use g_strdup_printf and completely avoid strcat, truncate request if we switched from POST to GET.