Skip to content

Commit

Permalink
Make it easier to switch between the global request method and a manager
Browse files Browse the repository at this point in the history
When you need to customize a header or timeout, this makes the delta
between your existing code and code using the manager smaller.
  • Loading branch information
sirwart authored and mattt committed Oct 20, 2014
1 parent be76488 commit dafd818
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/Alamofire.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,21 @@ public class Manager {

// MARK: -

/**
Creates a request for the specified method, URL string, parameters, and parameter encoding.

:param: method The HTTP method.
:param: URLString The URL string.
:param: parameters The parameters. `nil` by default.
:param: encoding The parameter encoding. `.URL` by default.

:returns: The created request.
*/
public func request(method: Method, _ URLString: URLStringConvertible, parameters: [String: AnyObject]? = nil, encoding: ParameterEncoding = .URL) -> Request {
return request(encoding.encode(URLRequest(method, URLString), parameters: parameters).0)
}


/**
Creates a request for the specified URL request.

Expand Down

0 comments on commit dafd818

Please sign in to comment.