[GH-ISSUE #212] Provide a method on OAuthSwiftClient that accepts a plain NSURLRequest #118

Closed
opened 2026-03-03 16:45:50 +03:00 by kerem · 2 comments
Owner

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

To interact with existing Objective C APIs, which often work with NSURLRequests, it would be nice to have a method on OAuthSwiftClient which accepts an NSURLRequest in addition to the more convenient method that accept URL string, parameters, headers and co.

With that it would also be possible to use advanced properties of NSURLRequest like cachePolicy and timeoutInterval.

Originally created by @FGoessler on GitHub (Apr 1, 2016). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/212 To interact with existing Objective C APIs, which often work with NSURLRequests, it would be nice to have a method on OAuthSwiftClient which accepts an NSURLRequest in addition to the more convenient method that accept URL string, parameters, headers and co. With that it would also be possible to use advanced properties of NSURLRequest like cachePolicy and timeoutInterval.
kerem closed this issue 2026-03-03 16:45:50 +03:00
Author
Owner

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

OAuthSwiftHTTPRequest have a private init with NSURLRequest. Don't know if already used.

So in OAuthSwiftClient a requestmethod could be created with NSURLRequest as parameter
makeRequest must be splitted to 3 functions

  • one with common code and parameters OAuthSwiftHTTPRequest
  • one with same signature as current one (and call the first one)
  • one with NSURLRequest (and call the first one)

PR if you want

<!-- gh-comment-id:204432288 --> @phimage commented on GitHub (Apr 1, 2016): `OAuthSwiftHTTPRequest` have a private init with `NSURLRequest`. Don't know if already used. So in `OAuthSwiftClient` a `request`method could be created with `NSURLRequest` as parameter `makeRequest` must be splitted to 3 functions - one with common code and parameters OAuthSwiftHTTPRequest - one with same signature as current one (and call the first one) - one with `NSURLRequest` (and call the first one) PR if you want
Author
Owner

@FGoessler commented on GitHub (Apr 3, 2016):

The initialiser on OAuthSwiftHTTPRequest which accepts an NSURLRequest isn't used yet, but imo also partially broken, since it doesn't extract the requests data into the OAuthSwiftHTTPRequest local properties (e.g. params, headers, ...) which might lead to confusion when requesting certain information about the request from an OAuthSwiftHTTPRequest object which are wrong then.

I'll try to fix that as well.

<!-- gh-comment-id:204970787 --> @FGoessler commented on GitHub (Apr 3, 2016): The initialiser on `OAuthSwiftHTTPRequest` which accepts an `NSURLRequest` isn't used yet, but imo also partially broken, since it doesn't extract the requests data into the `OAuthSwiftHTTPRequest` local properties (e.g. params, headers, ...) which might lead to confusion when requesting certain information about the request from an `OAuthSwiftHTTPRequest` object which are wrong then. I'll try to fix that as well.
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#118
No description provided.