0

I'm trying to get this to work.

http://www.dezrez.com/webguide/rezifeed.asp

I need to set the request header with certain values before calling the api url. How do i go about setting request header and calling the url after its been set in cakephp? Please let me know if further info is required.

Thanks

EDIT

Found this link http://lennaert.nu/2013/12/01/how-to-use-httpsocket-instead-of-curl-in-cakephp-2/ - httpsocket was what i used and it worked fine!

S.Simkhada
  • 116
  • 1
  • 2
  • 13
  • please show what have you tried so far – arilia May 30 '18 at 10:47
  • @arilia please see the edit. I think i'm quite a bit away from the solution... – S.Simkhada May 30 '18 at 11:07
  • 1
    I'm guessing here, but from what I understand, you want to call external URL in your controller and retrieve some data. If so, you need to do it using, eg, curl: http://php.net/manual/en/curl.examples-basic.php and set headers like is shown here: https://stackoverflow.com/questions/8115683/php-curl-custom-headers – Szymon May 30 '18 at 12:09
  • Great thanks, will give that a go. – S.Simkhada May 30 '18 at 14:04
  • `$_SERVER` gives you information about the request that your code is currently handling. It has nothing whatsoever to do with any requests your code might make to other servers. – Greg Schmidt May 31 '18 at 17:30
  • Yep, i was looking in wrong section. Got it sorted now using httpsocket! Thanks – S.Simkhada Jun 05 '18 at 08:11

0 Answers0