Given that for a @future annotated method:
one of the restrictions of future annotations is that you can not pass sObjects or objects as arguments
you have to create the JSON string in the trigger and then pass it to the method:
trigger MyTrigger on Contact (after insert, after update) { // This is sending an array Sender.post(JSON.serialize(Trigger.new)) } public class Sender { @future(callout=true) public static void post(String jsonString) { HttpRequest req = new HttpRequest(); req.setMethod('POST'); req.setBody(jsonString); ... } }
Alternatively you can pass an Id or Ids and query in the class. As in your comment you say there are objects of different types involved, probably best to pass the Ids and query in the class.