[GH-ISSUE #211] Provide a cancel function on OAuthSwiftHTTPRequest #120

Closed
opened 2026-03-03 16:45:50 +03:00 by kerem · 1 comment
Owner

Originally created by @FGoessler on GitHub (Apr 1, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/211

It would be nice to cancel running HTTP requests. NSURLSessionTask offers a simple API for that (just call cancel), but since the NSURLSessionTask is not exposed in the OAuthSwiftHTTPRequest class we cannot access it.

One could either provide a method on OAuthSwiftHTTPRequest to cancel the request or just expose the underlying task as a property.

Originally created by @FGoessler on GitHub (Apr 1, 2016). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/211 It would be nice to cancel running HTTP requests. NSURLSessionTask offers a simple API for that (just call cancel), but since the NSURLSessionTask is not exposed in the OAuthSwiftHTTPRequest class we cannot access it. One could either provide a method on OAuthSwiftHTTPRequest to cancel the request or just expose the underlying task as a property.
kerem 2026-03-03 16:45:50 +03:00
Author
Owner

@phimage commented on GitHub (Apr 1, 2016):

Add near session an attribute task into OAuthSwiftHTTPRequest and provide the stopor cancel function (function which do nothing if no task)

or alternatively add a callback on start method to get the task...

You can PR

<!-- gh-comment-id:204429971 --> @phimage commented on GitHub (Apr 1, 2016): Add near `session` an attribute `task` into `OAuthSwiftHTTPRequest` and provide the `stop`or `cancel` function (function which do nothing if no task) or alternatively add a callback on `start` method to get the `task`... You can PR
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#120
No description provided.