• 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: Exception using custom input stream for NSURLRequest
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception using custom input stream for NSURLRequest


  • Subject: Re: Exception using custom input stream for NSURLRequest
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 05 Feb 2012 14:52:51 -0800

On Feb 5, 2012, at 12:55 PM, Lou Zell wrote:

> Are you able to share your implementations for the two methods?

https://github.com/couchbaselabs/TouchDB-iOS/blob/master/Source/TDMultiInputStream.h
https://github.com/couchbaselabs/TouchDB-iOS/blob/master/Source/TDMultiInputStream.m

This class is an input-stream multiplexer: it concatenates multiple input sources (files, data, other input streams) and makes them readable as a single input stream. It can be used as the HTTPBodyStream of an NSURLRequest since it implements those two magic methods.

People doing MIME multipart uploads will also want to look at its subclass that does exactly that:

https://github.com/couchbaselabs/TouchDB-iOS/blob/master/Source/TDMultipartStreamer.h
https://github.com/couchbaselabs/TouchDB-iOS/blob/master/Source/TDMultipartStreamer.m

This just inserts the appropriate multipart boundary string in between the input sources to make them into a valid multipart body.

Note: These classes are basically standalone, but use some logging and unit-test functions from my MYUtilities library (https://github.com/snej/MYUtilities).

Note2: As part of the TouchDB project, these source files are released under the Apache 2 license.

—Jens
 _______________________________________________
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


References: 
 >Re: Exception using custom input stream for NSURLRequest (From: Jeff Johnson <email@hidden>)
 >Re: Exception using custom input stream for NSURLRequest (From: Jens Alfke <email@hidden>)
 >Re: Exception using custom input stream for NSURLRequest (From: Lou Zell <email@hidden>)

  • Prev by Date: Re: HTTPBodyStream without chunked encoding?
  • Next by Date: Re: Exception using custom input stream for NSURLRequest
  • Previous by thread: Re: Exception using custom input stream for NSURLRequest
  • Next by thread: Re: Exception using custom input stream for NSURLRequest
  • Index(es):
    • Date
    • Thread