cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Can't do GET requests!!!

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 26 Jun 2002 14:41:15 +0200 (MET DST)

On Wed, 26 Jun 2002, Oriol Magrané wrote:

> $ch = curl_init("https://www.google.com?variable=value");
>
> ...and when I run it, it gives me a lookup error (Couldn't resolve host
> 'www.google.com?variable=value'). Is this the way of making standard curl
> GET requests within PHP, or am I doing something wrong?

You are doing something wrong. You're providing curl with an illegally
formatted URL which makes it treat almost the entire string as a host name!

Try adding a slash before the question mark:

 "https://www.google.com/?variable=value"

-- 
    Daniel Stenberg -- I'll be away for a month, starting tomorrow
-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members! 
JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn
Received on 2002-06-26