如何一次将多个有效负载发送到SendGrid';Ruby中的API是什么?

如何一次将多个有效负载发送到SendGrid';Ruby中的API是什么?,ruby,post,sendgrid,Ruby,Post,Sendgrid,从下面的示例中,与API交互的curl命令应该如下所示: curl -X POST https://api.sendgrid.com/apiv2/reseller.manage.json \ -d api_user=reseller@company.com \ -d api_key=XXXXXXXX \ -d user=reseller_customer@company.com \ -d password=customernewpassword \ -d confirm_password=cus

从下面的示例中,与API交互的curl命令应该如下所示:

curl -X POST https://api.sendgrid.com/apiv2/reseller.manage.json \
-d api_user=reseller@company.com \
-d api_key=XXXXXXXX \
-d user=reseller_customer@company.com \
-d password=customernewpassword \
-d confirm_password=customernewpassword \
-d method=password

我该如何用Ruby编写呢?

您会想看看RestClient gem。这样发送请求就很容易了。

您可以通过使用ruby对url进行卷曲来使用SendGrid API。如果您不局限于使用curl,那么您应该看看官方的ruby gem,尽管使用Sendgrid SMTP API,但他们的文档中有代码示例;例如,请参见此处。

这是我需要的函数吗
RestClient.post'/data',{:foo=>bar',:multipart=>true}
自述文件不太清楚。不幸的是,gem只利用了它们的Web API。我需要使用他们的经销商API。