RTC Forums
November 24, 2024, 02:46:12 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Header Problem with Slim  (Read 4231 times)
ISIGest
RTC Expired
*
Posts: 121


« 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?
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.