This code works, and I can see the request go out to my php script through charles with my custom header GUID attached.
NSMutableURLRequest *loginRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:feedURLString]];
NSData *myRequestData = [NSData dataWithBytes:[myRequestString UTF8String]length:[myRequestString length]];
[ loginRequest setHTTPMethod: @"POST" ];
[ loginRequest setHTTPBody: myRequestData ];
[ loginRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"content-type"];
[ loginRequest setValue:@"testdatainguid" forHTTPHeaderField:@"GUID" ];
In php, I tried to read the header
if(isset($_SERVER['GUID']))
{
echo($_SERVER['GUID']);
}
I don't get any response. I tried getheaders, $_POST, $_GET and anything else I could think of, but I can't seem to get that data in my php. Any help would be greatly appreciated.
I'd expect it in $_SERVER['HTTP_GUID']
, as other HTTP headers are.
You can always print_r($_SERVER) to figure out if it's being set, and/or find out how it's being set.