CFReadStreamCreateForHTTPRequest()
CFReadStreamCreateForHTTPRequest()
- Subject: CFReadStreamCreateForHTTPRequest()
- From: Pete Carss <email@hidden>
- Date: Fri, 20 Jun 2003 19:40:16 +0100
Maybe the wrong list - but there was more talk of CFNetwork in this
list than 'macnetworkprog' and anyway I'm trying to call CFNetwrok from
Obj-C...
The problem: I'm trying to do an HTTP POST with binary data in the
body...exactly like a file upload form in html...
So I read the CFNetwork docs - watched the WWDC video - looked through
the sample code and found this:
NSData *payload = [[NSData alloc]
initWithContentsOfFile:[payloadPathTextField stringValue]];
CFHTTPMessageSetBody(request, (CFDataRef)payload);
but that doesn't seem to work - even the demo app crashes with sigbus.
The WWDC video said if you have a big payload use:
CFReadStreamCreateForStreamedHTTPRequest() - if I use this - I get an
error in httpd-error.log - that chunked transfer encoding is forbidden
- back to the docs - they say that you need to set 'Content-Length' in
the request header - but this doesn't seem to be having any effect -
and I always end up needing to know the sizeof() the data a handle
points to...
Anybody got a binary upload to work with CFNetwork?
BTW I tried CURLHandle - but the demo app for that didn't seem to be
able to do it either...
Pete Carss
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.