Re: why is my download request using HTTP POST is split in header and body ?
Re: why is my download request using HTTP POST is split in header and body ?
- Subject: Re: why is my download request using HTTP POST is split in header and body ?
- From: Jeremy Wyld <email@hidden>
- Date: Thu, 13 May 2004 10:24:40 -0700
I believe the problem is with this header value. CFHTTP serializes
whatever you give it and it doesn't deal with your embedded "\r\n".
This will cause two requests to be sent by CFHTTP, one that is pretty
much formatted and another that it just bad.
sprintf(szBoundary, "multipart/form-data; boundary=%s\r\n",
mytransfer.m_Boundary);
CFStringRef MyBoundary;
MyBoundary = CFStringCreateWithFormat( kCFAllocatorDefault, NULL,
CFSTR( "%s" ), szBoundary );
CFStringRef HeaderBoundary;
HeaderBoundary = CFStringCreateWithFormat( kCFAllocatorDefault,
NULL,
CFSTR( "%s" ), "Content-Type" );
CFHTTPMessageSetHeaderFieldValue( messageRef, HeaderBoundary,
MyBoundary );
POST /transfer HTTP/1.1
Content-Type: multipart/form-data; boundary=----ADP_05122004114824
User-Agent: InetURL/1.0
Host: 1xx.1xy.163.114
Content-Length: 455
Connection: Keep-Alive
Cache-Control: nocache
Is actually becoming
POST /transfer HTTP/1.1
Content-Type: multipart/form-data; boundary=----ADP_05122004114824
User-Agent: InetURL/1.0
Host: 1xx.1xy.163.114
Content-Length: 455
Connection: Keep-Alive
Cache-Control: nocache
The first is a somewhat good request although not 1.1 compliant. The
second is obvious garbage. Try removing the "\r\n" from your header
value and things should be good.
jeremy
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.