UNPKG

886 Btext/x-cView Raw
1/*
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#import <Foundation/Foundation.h>
9
10typedef void (^RCTMultipartCallback)(NSDictionary *headers, NSData *content, BOOL done);
11typedef void (^RCTMultipartProgressCallback)(NSDictionary *headers, NSNumber *loaded, NSNumber *total);
12
13
14// RCTMultipartStreamReader can be used to parse responses with Content-Type: multipart/mixed
15// See https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
16@interface RCTMultipartStreamReader : NSObject
17
18- (instancetype)initWithInputStream:(NSInputStream *)stream boundary:(NSString *)boundary;
19- (BOOL)readAllPartsWithCompletionCallback:(RCTMultipartCallback)callback
20 progressCallback:(RCTMultipartProgressCallback)progressCallback;
21
22@end