Fix the issue that the NSURLRequest method should not be nil.

This commit is contained in:
DreamPiggy 2020-06-11 18:01:14 +08:00
parent c4acfe5e81
commit 2d33fc8e6e
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@
}
- (instancetype)initWithMethod:(NSString *)method headers:(NSDictionary<NSString *,NSString *> *)headers body:(NSData *)body {
method = [method copy];
method = method ? [method copy] : @"GET";
headers = [headers copy];
body = [body copy];
return [self initWithBlock:^NSURLRequest * _Nullable(NSURLRequest * _Nonnull request) {