function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
arun Bikkasaniarun Bikkasani 

i need to send data as csv file in http request to third party externa system

AbhishekAbhishek (Salesforce Developers) 
https://developer.salesforce.com/forums/?id=9060G000000Xdk4QAC

You can try the suggestions mentioned in the above developer discussion.


Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks.
AnudeepAnudeep (Salesforce Developers) 
Hi Arun, 

Here is a sample code 
 
HttpRequest req = new HttpRequest();
req.setEndpoint(endpoint);
req.setBody(reportText);
req.setHeader('Content-Type','text/csv');
req.setHeader('Content-Length',String.valueOf(reportText.length()));
req.setMethod('POST');

HttpResponse response = new Http().send(req);
// Check for 200 status here

See this post to learn more

If you find this information helpful, please mark this answer as Best. It may help others in the community

Thanks, 
Anudeep
arun Bikkasaniarun Bikkasani
Hi Anudeep,

Thanks for your reply , i need without vf page, .  my scenario is every 5 :00 Pm i need to send this file to external system. 

Regards,
Arun