This repository was archived by the owner on Mar 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,10 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options
223
223
{
224
224
defaultConfigObject.timeoutIntervalForRequest = timeout/1000 ;
225
225
}
226
+
227
+ defaultConfigObject.sessionSendsLaunchEvents = YES ;
228
+ defaultConfigObject.discretionary = NO ;
229
+
226
230
defaultConfigObject.HTTPMaximumConnectionsPerHost = 10 ;
227
231
session = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: taskQueue];
228
232
if (path != nil || [self .options valueForKey: CONFIG_USE_TEMP]!= nil )
@@ -254,7 +258,13 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options
254
258
respFile = NO ;
255
259
}
256
260
257
- __block NSURLSessionDataTask * task = [session dataTaskWithRequest: req];
261
+ __block NSURLSessionDataTask * task;
262
+ if (path && req.HTTPMethod == @" POST" ) {
263
+ task = [session uploadTaskWithRequest: req fromFile: path];
264
+ } else {
265
+ task = [session dataTaskWithRequest: req];
266
+ }
267
+
258
268
[taskTable setObject: task forKey: taskId];
259
269
[task resume ];
260
270
You can’t perform that action at this time.
0 commit comments