Help with Alamofire and YouTube Data API

I am creating an app for my YouTube channel and I am using Alamofire (which I installed using CocoaPods) and the YouTube API


I am having some trouble, though. I am using Swift 3 (xcode 8) and whenever I do the Alamofire.request Ii get an error "Extra argument 'method' in call". Here's the code:

Alamofire.request("https://www.googleapis.com/youtube/v3/playlistItems", method: .get, parameters: ["part":"snippet", "playlistId":"UUjZO5rUYPPAgCSOvHmkHU3A", "key":"AIzaSyBGmnL1R2vdSbhVdrRykBsOHovyFHbDdAg"], encoding: URLEncoding, headers: nil)

With Swift 3, this is what the request looks like without me filling in any detail.

Alamofire.request (url: URLConvertible, method: HTTPMethod, parameters: Parameters? , encoding: ParameterEncoding , headers: HTTPHeaders)

Can you please help me fix this issue?

Replies

I think you might have more luck asking this question in the support channel recommended by Alamofire.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

please try following code ,just modify paramters. hope help you .


Alamofire.request(urladdress, method: .get, parameters: params, encoding: JSONEncoding.default, headers: nil)

.responseJSON()

{

(response:DataResponse<Any>) in

print (response.data)

}