I am calling Twilio client to make a phone call and providing To, From and url parameters. I want to set XSRF token as part of the url so that when twilio call the url the token will be validated and my rest api send the twiml expression so that twilio will call other phone number and connect both the calls. Is there any way I can set XSRF token as part of the header. Below is my code.
TwilioRestClient client = new TwilioRestClient(accountSid, authToken);
Account mainAccount = client.getAccount();
CallFactory callFactory = mainAccount.getCallFactory();
Map<String, String> callParams = new HashMap<String, String>();
callParams.put("To", "+1 xxx-xxx-xxxx");
callParams.put("From", "+1 xxx-xxx-xxxx");
callParams.put("X-XSRF-TOKEN", "token");
callParams.put("Url", "myurl/+1xxx-xxx-xxxx");
try {
Call call = callFactory.create(callParams);
} catch (TwilioRestException e) {
e.printStackTrace();
}