Skip to content

Instantly share code, notes, and snippets.

View danielcosta27's full-sized avatar

Daniel Costa danielcosta27

  • Florianopolis - Brazil
View GitHub Profile
@danielcosta27
danielcosta27 / network-upload-snnipet.swift
Last active December 19, 2017 17:09
Snippet of Network wrapper service using Alamofire upload (Swift 3)
//Methods to be inside the network wrapper service
private class func _prepareRequest (_ strUrl: String, params: JSON?, method: String = Methods.GET) -> URLRequest {
var signature = ""
let url = URL(string: Config.API_URL + strUrl)!
var urlRequest = URLRequest(url: url)
urlRequest.httpMethod = method
urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")
urlRequest.setValue(Config.APPID, forHTTPHeaderField: CustomHeaders.APP_ID)