• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: simple CFHTTP API question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple CFHTTP API question


  • Subject: Re: simple CFHTTP API question
  • From: Mark Pauley <email@hidden>
  • Date: Fri, 7 Aug 2009 16:14:02 -0700

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
  • Follow-Ups:
    • Re: simple CFHTTP API question
      • From: augusto callejas <email@hidden>
References: 
 >simple CFHTTP API question (From: augusto callejas <email@hidden>)

  • Prev by Date: simple CFHTTP API question
  • Next by Date: Re: simple CFHTTP API question
  • Previous by thread: simple CFHTTP API question
  • Next by thread: Re: simple CFHTTP API question
  • Index(es):
    • Date
    • Thread