Re: simple CFHTTP API question
Re: simple CFHTTP API question
- Subject: Re: simple CFHTTP API question
- From: augusto callejas <email@hidden>
- Date: Fri, 7 Aug 2009 16:23:43 -0700
thanks!
also, is there a function for URL encoding strings?
i may want to include characters that are normally reserved, like
equals sign:
"http://localhost/?q=="
i'd like it to automatically convert "=" into "="
thanks,
augusto.
On Aug 7, 2009, at 4:14 PM, Mark Pauley wrote:
No you do not need to also add ?q=1 to the body, unless your server
expects the inputs in a POST request. The code you listed below
(after giving the URL to an CFHTTPMessage and creating an
HTTPReadStream via the API) will send:
GET /?q=1 HTTP/1.1
<headers>
<empty line>
to the server at localhost on port 80. I'm guessing that your
server software will then parse the query string '?q=1' into
something useful on your end.
I believe this is query string is expected from a web browser when
sending forms from html pages if a certain option (method = get) is
set.
you might wish to take a look at http://www.w3.org/TR/html401/interact/forms.html
which might clear things up. PHP commonly handles the parsing of
either the POST with the inputs in the body data or the GET with the
inputs in the url.
On Aug 7, 2009, at 3:46 PM, augusto callejas wrote:
hi-
i want to make a GET request at "http://localhost/?q=1".
is this the proper approach?
CFStringRef url = CFSTR("http://localhost/?q=1");
CFURLRef myURL = CFURLCreateWithString(kCFAllocatorDefault, url,
NULL);
or do i need to encode the "q=1" portion into the body of the
request?
thanks,
augusto.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_Mark
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden