خرید بک لینک

Vote count: 0

I can't solve this problem for about 2 days now, I want data from Food2Fork API, but still have an error "Missing Mashape application key" but I have Mashape Key in header.. Maybe there is something bad with my request.

Constants.swift

let API_KEY = "42d72354227d6e455679488ce2dceb55"
let SEARCH_URL = "https://community-food2fork.p.mashape.com/search?key=(API_KEY)&q="
let X_MASHUP_KEY = "TsLaXgXz5tmshzlqACubx3q86GV5p1rs1rSjsn04mIJoMoZYjl"

Receipt.swift

func downloadRecipes(completed: DownloadComplete) {

    let recipesURL = URL(string: "(SEARCH_URL)chicken")

    Alamofire.request(recipesURL!, method: .get, headers: ["(X_MASHUP_KEY)": "(API_KEY)", "Accept application" : "json"]).responseJSON() { response in
        let result = response.result
        print(result)
    }
    completed()
}

asked 10 secs ago

برچسب: alamofire xcode 8, نویسنده: استخدام کار تاريخ: جمعه 19 شهريور 1395 ساعت: 6:09

صفحه بندی