BWSMixedReplaceHTTPRequestOperation
is an AFHTTPRequestOperation
subclass for handling multipart/x-mixed-replace
, for use with AFNetworking
Cocoa projects. This is useful for streaming data from web servers, like IP cameras or biometric sensors.
- Add
BWSMixedReplaceHTTPRequestOperation.[hm]
into your Xcode project that is already set up to useAFNetworking
. - Call
mixedReplaceOperationWithRequest:replacementReceived:success:failure
, wherereplacementReceived
a block executed with the last complete chunk of data received.- Note that it is the caller's responsibility to ensure that the data provided is well-formed. In cases where large data chunks is being streamed extremely rapidly, iOS could truncate a chunk to keep up.
- Clone the
Multipart-Streaming-HTTP-Server
submodule. - Run
server.rb
- This will create a server running on port 8080 on your local machine that streams the current date and time for 10 seconds.
This software was developed at the National Institute of Standards and Technology (NIST) by employees of the Federal Government in the course of their official duties. Pursuant to title 17, section 105 of the United States Code, this software is not subject to copyright protection and is in the public domain. NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
Licensing information for Multipart-Streaming-HTTP-Server
and AFNetworking
can be found on the Multipart-Streaming-HTTP-Server
and AFNetworking
GitHub pages respectively.