[GH-ISSUE #323] need to edit "name" value to upload image #200

Closed
opened 2026-03-03 16:46:37 +03:00 by kerem · 2 comments
Owner

Originally created by @maundytime on GitHub (Dec 16, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/323

Description:

I need to edit "name" value to upload image. The website fanfou.com use "image" and "photo". In OAuthSwift, the name value is "media". I didn't find a way to change it without edit OAuthSwift project in pod... I also can't make extension to OAuthSwift outside of the pod since "multiDataFromObject(...)" func is internal. Would like to hear some suggestions... Thanks.

Where "name" is...
2016-12-16 2 02 45

The extension inside pod I write now... The extension would disappear when I update pod.
Fanfou.com do not accept "parameters" when they are already in "body", so I use func "request(...)" without the "parameters".
2016-12-16 2 46 41

OAuth Provider (Twitter, Github, ..):

fanfou.com

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Manually

Library version:

  • 1.1.0
  • head
  • v1.0.0
  • v0.6
  • other: (Please fill in the version you are using.)

Xcode version:

  • 8.0 (Swift 3.0)

  • 8.0 (Swift 2.3)

  • 7.3.1

  • other: (Please fill in the version you are using.)

  • objective c

Originally created by @maundytime on GitHub (Dec 16, 2016). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/323 ### Description: I need to edit "name" value to upload image. The website fanfou.com use "image" and "photo". In OAuthSwift, the name value is "media". I didn't find a way to change it without edit OAuthSwift project in pod... I also can't make extension to OAuthSwift outside of the pod since "multiDataFromObject(...)" func is internal. Would like to hear some suggestions... Thanks. Where "name" is... <img width="1113" alt="2016-12-16 2 02 45" src="https://cloud.githubusercontent.com/assets/3490007/21253425/7c55e6e8-c399-11e6-9b38-b75bb7b59c10.png"> The extension inside pod I write now... The extension would disappear when I update pod. _Fanfou.com do not accept "parameters" when they are already in "body", so I use func "request(...)" without the "parameters"._ <img width="1341" alt="2016-12-16 2 46 41" src="https://cloud.githubusercontent.com/assets/3490007/21254232/ed12637a-c39e-11e6-9361-63ec487df8a2.png"> ### OAuth Provider (Twitter, Github, ..): fanfou.com ### OAuth Version: - [x] Version 1 - [ ] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Manually ### Library version: - [x] 1.1.0 - [ ] head - [ ] v1.0.0 - [ ] v0.6 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 8.0 (Swift 3.0) - [ ] 8.0 (Swift 2.3) - [ ] 7.3.1 - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem 2026-03-03 16:46:37 +03:00
Author
Owner

@phimage commented on GitHub (Dec 16, 2016):

for your workflow until a solution is found, you can checkout OAuthSwift somewhere, edit it
and then in your project Podfile use
pod 'OAuthSwift', :path => 'path/where/you/checkout/OAuthSwift/OAuthSwift.podspec'


makeMultiPartRequest(_ urlString: String, method: OAuthSwiftHTTPRequest.Method, parameters: OAuthSwift.Parameters = [:], multiparts: Array<OAuthSwiftMultipartData> = [], headers: OAuthSwift.Headers? = nil) is open and accessible from outside, you can use it

multiPartRequest call by postImage is an example of multipart post request

<!-- gh-comment-id:267621823 --> @phimage commented on GitHub (Dec 16, 2016): for your workflow until a solution is found, you can checkout OAuthSwift somewhere, edit it and then in your project Podfile use pod 'OAuthSwift', :path => 'path/where/you/checkout/OAuthSwift/OAuthSwift.podspec' --- `makeMultiPartRequest(_ urlString: String, method: OAuthSwiftHTTPRequest.Method, parameters: OAuthSwift.Parameters = [:], multiparts: Array<OAuthSwiftMultipartData> = [], headers: OAuthSwift.Headers? = nil)` is open and accessible from outside, you can use it `multiPartRequest ` call by `postImage` is an example of multipart post request
Author
Owner

@maundytime commented on GitHub (Dec 17, 2016):

Got it. I would try this. Thank for help~

<!-- gh-comment-id:267743705 --> @maundytime commented on GitHub (Dec 17, 2016): Got it. I would try this. Thank for help~
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#200
No description provided.