[PR #114] [MERGED] Allow to use OAuthSwift with custom network call or other network API #524

Closed
opened 2026-03-03 16:49:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/114
Author: @phimage
Created: 9/27/2015
Status: Merged
Merged: 10/4/2015
Merged by: @dongri

Base: masterHead: cleaning-client


📝 Commits (2)

  • 87aa075 Allow to use OAuthSwift with custom network call or other network API
  • 2d0a3a3 Merge branch 'master' into cleaning-client

📊 Changes

3 files changed (+111 additions, -100 deletions)

View changed files

📝 OAuthSwift/OAuthSwiftClient.swift (+30 -99)
📝 OAuthSwift/OAuthSwiftCredential.swift (+76 -0)
📝 OAuthSwift/OAuthSwiftHTTPRequest.swift (+5 -1)

📄 Description

  • Factorising method to create OAuthSwiftHTTPRequest
  • Move method about credential into OAuthSwiftCredential instead of OAuthSwiftClient
  • Extract method to create headers from credential
  • Add method to create NSMutableURLRequest from OAuthSwiftHTTPRequest (just calling the static one)

I have just extracting and moving codes, no change

With this public methods its now easy to create a custom NSMutableURLRequest with headers from credential, or just get the one created by this api

We can for instance use Alamofire like that

 extension OAuthSwiftHTTPRequest : URLRequestConvertible {

public var URLRequest: NSMutableURLRequest {
        return try! self.makeRequest()
}

or just by adding headers as parameter of request Alamofire function using makeHeadersnew function from OAuthSwiftCredential


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OAuthSwift/OAuthSwift/pull/114 **Author:** [@phimage](https://github.com/phimage) **Created:** 9/27/2015 **Status:** ✅ Merged **Merged:** 10/4/2015 **Merged by:** [@dongri](https://github.com/dongri) **Base:** `master` ← **Head:** `cleaning-client` --- ### 📝 Commits (2) - [`87aa075`](https://github.com/OAuthSwift/OAuthSwift/commit/87aa0751e40a42e1fb6dcc6158ac0db6a09002d9) Allow to use OAuthSwift with custom network call or other network API - [`2d0a3a3`](https://github.com/OAuthSwift/OAuthSwift/commit/2d0a3a3502017dfe24f8b338a98effde7a6fdf38) Merge branch 'master' into cleaning-client ### 📊 Changes **3 files changed** (+111 additions, -100 deletions) <details> <summary>View changed files</summary> 📝 `OAuthSwift/OAuthSwiftClient.swift` (+30 -99) 📝 `OAuthSwift/OAuthSwiftCredential.swift` (+76 -0) 📝 `OAuthSwift/OAuthSwiftHTTPRequest.swift` (+5 -1) </details> ### 📄 Description - Factorising method to create `OAuthSwiftHTTPRequest` - Move method about credential into `OAuthSwiftCredential` instead of `OAuthSwiftClient` - Extract method to create headers from credential - Add method to create `NSMutableURLRequest` from `OAuthSwiftHTTPRequest` (just calling the static one) I have just extracting and moving codes, no change With this public methods its now easy to create a custom `NSMutableURLRequest` with headers from credential, or just get the one created by this api We can for instance use Alamofire like that ``` swift extension OAuthSwiftHTTPRequest : URLRequestConvertible { public var URLRequest: NSMutableURLRequest { return try! self.makeRequest() } ``` or just by adding headers as parameter of `request` Alamofire function using `makeHeaders`new function from `OAuthSwiftCredential` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:49:16 +03:00
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#524
No description provided.