It's been quite some time, but what it looks like the problem is your last parameter, you're defining it as char headers[]; while it should be a string like string headers;
char headers[];
string headers;