我需要在外部文件夹中发布或删除CSV文件。我已经建立了Future方法,在此之前我已经使用了Try方法,如下所示。
try{
String endpoint = 'http://api.maropost.com/accounts/1173/emails/deliver.json?auth_token=XXXXXXXXXXXXXXXXXXXXX%^&*778843453Tttyh';
HttpRequest req = new HttpRequest();
req.setEndpoint(endpoint);
req.setMethod('POST');
req.setHeader('Content-type', 'application/json');
req.setbody(JSON.serialize(myEmail));
Http http = new Http();
}
现在,我有以下端点和身份验证密钥以及一个Curl示例。我该如何实现?
API URL: https://api.integrishield.com/api/csv
authorization token: af2257c91097e0d3ae20fa651d87643055d4c0ca6850d8534519a231c168ee1d
CURL Example
curl -X POST -F file=@PATH TO LOCAL CSV FILE -H "Authorization: Token AUTH TOKEN" API URL