RTC Forums

Subscription => Support => Topic started by: ISIGest on August 03, 2015, 08:35:09 PM



Title: Header Problem with Slim
Post by: ISIGest on August 03, 2015, 08:35:09 PM
Hi Danijel i'm try to use a TRtcDataRequest with Slim PHP Framework as webservice.
When I try to send a custom header to my php server it does not arrive:

Code:
  
  dr1.Request.HeaderText := 'Authorization: secret blablabla';
  dr1.Request.Method := 'POST';
  dr1.Request.FileName:='/get';
  dr1.Request.Host:= 'www.mysite.com';
  dr1.Post();

I debug php and receive in header only "Host = www.mysite.com"
How can I test?


Title: Re: Header Problem with Slim
Post by: D.Tkalcec (RTC) on August 04, 2015, 11:02:27 AM
The "Request.HeaderText" property is used to assign the complete HTTP header in a single statement.
What you should do instead, if you only want to assign some HTTP header values, is this:

  dr1.Request['Authorization'] := 'secret blablabla'; // set the "Authorization" HTTP header
  dr1.Request.Method := 'POST'; // set the HTTP method, which is also part of the HTTP header
  dr1.Request.FileName:='/get'; // set the file name, which is part of the HTTP header
  dr1.Request.Host:= 'www.mysite.com'; // set the "Host" HTTP header
  dr1.Post();

Best Regards,
Danijel Tkalcec