why i am getting HTTP1.1 Bad Request

Discussion in 'PHP' started by adrevol, May 26, 2008.

  1. #1
    Hi all,

    i have a url where it will give xml result
    lets say www.xyz.com/abc/def/?p1=v1&p2=v2

    what i want to know is , when i query with file_get_contents it is giving me HTTP1.1 Bad Request ,

    $url="http://www.xyz.com/abc/def/?p1=v1&p2=v2";
    $xml=file_get_contents($url);

    even i tried with curl .. that is also happening same ...

    what is wrong with my code or is there any other way to get the contents of xml ...
     
    adrevol, May 26, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Have you tried URL Encoding your parameters?

    Jay
     
    jayshah, May 26, 2008 IP
  3. newcity

    newcity Peon

    Messages:
    1,015
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #3
    seems your server needs to be configured with php_mod rewrite , tell your server about this problem. they surely might have some solution . ;)

    Newcity, :)
     
    newcity, May 26, 2008 IP