Html 将注册表单数据卷曲到MailChimp

Html 将注册表单数据卷曲到MailChimp,html,curl,mailchimp,Html,Curl,Mailchimp,在使用curl复制表单提交时,我无法成功获得MailChimp注册。目前正在接收404 curl --fail -X POST -H ‘Content-Type:application/x-www-form-urlencoded’ -d ‘EMAIL=TestEmail@gmail.com’ -d ’b_485e6665509b1dca9cf1bcb26_d561f45431=’ -d ‘subscribe=Subscribe’ https://twitter.us18.list-manage.

在使用curl复制表单提交时,我无法成功获得MailChimp注册。目前正在接收404

curl --fail -X POST -H ‘Content-Type:application/x-www-form-urlencoded’ -d ‘EMAIL=TestEmail@gmail.com’ -d ’b_485e6665509b1dca9cf1bcb26_d561f45431=’ -d ‘subscribe=Subscribe’ https://twitter.us18.list-manage.com/subscribe/post?u=485e6665509b1dca9cf1bcb26&id=d561f45431
使用MailChimp中的嵌入式代码,我设置了一个bin端点来检查正在传递的头/负载,这样我就可以使用上面的curl命令复制它

Headers
X-Google-Apps-Metadata domain=gmail.com,host=*.mockable.io
Accept-Language en-GB,en-US;q=0.9,en;q=0.8
X-Appengine-Citylatlong -33.867487,151.206990
X-Cloud-Trace-Context 75c9528ee08db8469efc3c1a34d72a0a/1679801727246466213
Origin http://romantic-wool.surge.sh
X-Appengine-Default-Namespace gmail.com
Referer http://romantic-wool.surge.sh/
X-Appengine-Region nsw
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Host demo0541952.mockable.io
Cache-Control max-age=0
Content_Type application/x-www-form-urlencoded
Content_Length 66
X-Appengine-City sydney
X-Appengine-Country AU
Content-Type application/x-www-form-urlencoded
Upgrade-Insecure-Requests 1
Cookie __utmc=260836241; _ga=GA1.2.1607676483.1525841229; _gid=GA1.2.1814557639.1525841235; __utmz=260836241.1525927272.4.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __utma=260836241.1607676483.1525841229.1525944073.1525951960.7
表格数据/有效载荷:

EMAIL=&b_485e6665509b1dca9cf1bcb26_d561f45431=&subscribe=Subscribe

我所能想到的就是字符串“B485E665509B1DCA9CF1BCB26_d561f45431”的语法错误。

我已经能够找出我原来的curl命令不起作用的原因

Bash将URL参数中的符号解释为试图运行的单独命令,导致URL格式错误且不完整。解决这一问题的工作只是将URL用引号括起来。除此之外,通过使用-d选项,命令的请求类型默认为POST,从而消除了-X指定请求类型的需要。下面是在这个实例中成功使用的curl命令

curl -d 'EMAIL=TestEmail@gmail.com' -d 'b2_485e6665509b1dca9cf1bcb26_d561f45431=' -d 'subscribe=Subscribe' 'https://twitter.us18.list-manage.com/subscribe/post?u=485e6665509b1dca9cf1bcb26&id=d561f45431'
这样做的好处是将所有选项参数都用引号括起来。这确保bash不会将任何特殊字符解释为单独的命令