• 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: why is my download request using HTTP POST is split in header and body ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >why is my download request using HTTP POST is split in header and body ? (From: "Hans Loonen" <email@hidden>)

  • Prev by Date: Re: why is my download request using HTTP POST is split in header and body ?
  • Next by Date: HTTPS streams through a proxy
  • Previous by thread: Re: why is my download request using HTTP POST is split in header and body ?
  • Next by thread: HTTPS streams through a proxy
  • Index(es):
    • Date
    • Thread