SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict lmasi02's Avatar
    Join Date
    Aug 2004
    Location
    Zambia
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HttpRequest exception

    Dear Guru

    i have a code herebelow (IP changed). when i run a tests on the localhost with the index page, it is working fine but when i requested to a server, it if failing with the following error
    exception 'HttpInvalidParamException' with message 'Empty or too short HTTP message: '.'' in C:\wamp\www\tests1.php:5 Stack trace: #0 C:\wamp\www\tests1.php(5): HttpRequest->send() #1 {main}
    PHP Code:
    <?php 
    $r 
    = new HttpRequest('http://192.168.1.10:8090/cbin/cpsmssubscription?KEYWORD=USAGE&MESSAGE=INET&MSISDN=260971578779');
    try {
        echo 
    $r->send()->getResponseBody();
    } catch (
    HttpException $ex) {
        echo 
    $ex;
    }
    ?>
    Advise what could be the problem.
    Power of Knowledge

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,095
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    192.168.1.10 is a local network address, so I'm guessing that server can be reached from your localhost, but it can't be reached from the public server, which is why it throws the error.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Addict lmasi02's Avatar
    Join Date
    Aug 2004
    Location
    Zambia
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ScallioXTX View Post
    192.168.1.10 is a local network address, so I'm guessing that server can be reached from your localhost, but it can't be reached from the public server, which is why it throws the error.
    thanks for the reply, this is being called for the private and not the public. the IP address is reachable( ping)
    Power of Knowledge

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    HttpInvalidParamException sounds quite specific; check this page out.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •