0

I have the following php code:

#!/usr/bin/php -q
<?php
require_once 'HttpRequest.php';
$r = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet.php", HttpRequest::METH_GET);
//$r_test = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet-test.php", HttpRequest::METH_GET);
$r_test = new HttpRequest("http://192.168.0.223:8080/dsrmap/msfleet-dev.php", HttpRequest::METH_GET);

when I run this I get the message:

PHP Fatal error:  Undefined class constant 'METH_GET' in /home/jsnyder/jsonmaker/map.php 

Fatal error: Undefined class constant 'METH_GET' in /home/jsnyder/jsonmaker/map.php 

do you know what is causing this error. I had to manually download a HttpRequest and put it in the directory that this program is in because I got the error:

 PHP Fatal error:  Class 'HttpRequest' not found in /home/jsnyder/jsonmaker/map.php

Based on the information I gave can you help me resolve this issue? How am I supposed to install HttpRequest so I can use this in my code?

Thank you for your help

jms1980
  • 1,017
  • 1
  • 21
  • 37

1 Answers1

0

had to manually download a HttpRequest and put it in the directory that this program is in because I got the error:

That sounds to me like you downloaded a random class with the same name somewhere and crossed your fingers it would work.

It's likely you simply have the picked the wrong library.

Evert
  • 93,428
  • 18
  • 118
  • 189