Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFNetwork, HTTP and POST messages



Hello All,

Thanks to your help, my problem is now resolved.

Becky Willrich's instruction (quoted below) allowed me to see post data when using tcpflow (Great utility! Thanks again Jim!). It looks like one should set the "Content-Type" header field to "application/x-www-form-urlencoded" when posting data to a WEB server (Apache), otherwise the server does not pass the POST data to the PHP page.

You need to configure the request BEFORE creating the stream - the two CFReadStreamCreate calls will take a copy of the request. That's probably why the body of the request is empty. Just move the CFHTTPMessageAddAuthentication(), CFHTTPMessageSetHeaderFieldValue(), and CFHTTPMessageSetBody() calls to prior to the CFReadStreamCreate() calls.

Hope that helps,
REW

_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.