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
223223 {
224224 defaultConfigObject.timeoutIntervalForRequest = timeout/1000 ;
225225 }
226+
227+ defaultConfigObject.sessionSendsLaunchEvents = YES ;
228+ defaultConfigObject.discretionary = NO ;
229+
226230 defaultConfigObject.HTTPMaximumConnectionsPerHost = 10 ;
227231 session = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: taskQueue];
228232 if (path != nil || [self .options valueForKey: CONFIG_USE_TEMP]!= nil )
@@ -254,7 +258,13 @@ - (void) sendRequest:(__weak NSDictionary * _Nullable )options
254258 respFile = NO ;
255259 }
256260
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+
258268 [taskTable setObject: task forKey: taskId];
259269 [task resume ];
260270
You can’t perform that action at this time.
0 commit comments