@@ -37,17 +37,17 @@ public enum WebAPIRequestMethod: String {
3737}
3838
3939public struct WebAPIHeaderKey {
40- static let Accept = " Accept "
41- static let Date = " Date "
42- static let ContentType = " Content-Type "
43- static let ContentMD5 = " Content-MD5 "
44- static let ContentLength = " Content-Length "
45- static let Authorization = " Authorization "
40+ public static let Accept = " Accept "
41+ public static let Date = " Date "
42+ public static let ContentType = " Content-Type "
43+ public static let ContentMD5 = " Content-MD5 "
44+ public static let ContentLength = " Content-Length "
45+ public static let Authorization = " Authorization "
4646}
4747
4848public struct WebAPIHeaderValue {
49- static let ApplicationJson = " application/json "
50- static let ImagePNG = " image/png "
49+ public static let ApplicationJson = " application/json "
50+ public static let ImagePNG = " image/png "
5151}
5252
5353public struct WebAPIInjectedResponse {
@@ -104,7 +104,7 @@ public class WebAPI {
104104 public var baseURL : NSURL ?
105105 public var injectedResponses : [ String : WebAPIInjectedResponse ] = [ String : WebAPIInjectedResponse] ( )
106106 public var sessionDelegate : NSURLSessionDelegate ?
107- private lazy var session : NSURLSession = {
107+ public lazy var session : NSURLSession = {
108108 [ unowned self] in
109109 let configuration = NSURLSessionConfiguration . defaultSessionConfiguration ( )
110110 return NSURLSession ( configuration: configuration, delegate: self . sessionDelegate, delegateQueue: nil )
@@ -117,19 +117,19 @@ public class WebAPI {
117117
118118 // MARK: - Convenience Methods
119119
120- public final func get( path: String , queryItems: [ NSURLQueryItem ] ? , completion: WebAPICompletion ) {
120+ public final func get( path: String , queryItems: [ NSURLQueryItem ] ? = nil , completion: WebAPICompletion ) {
121121 execute ( path, queryItems: queryItems, method: . Get, data: nil , completion: completion)
122122 }
123123
124- public final func put( data: NSData ? , path: String , queryItems: [ NSURLQueryItem ] ? , completion: WebAPICompletion ) {
124+ public final func put( data: NSData ? , path: String , queryItems: [ NSURLQueryItem ] ? = nil , completion: WebAPICompletion ) {
125125 execute ( path, queryItems: queryItems, method: . Put, data: data, completion: completion)
126126 }
127127
128- public final func post( data: NSData ? , path: String , queryItems: [ NSURLQueryItem ] ? , completion: WebAPICompletion ) {
128+ public final func post( data: NSData ? , path: String , queryItems: [ NSURLQueryItem ] ? = nil , completion: WebAPICompletion ) {
129129 execute ( path, queryItems: queryItems, method: . Post, data: data, completion: completion)
130130 }
131131
132- public final func delete( path: String , queryItems: [ NSURLQueryItem ] ? , completion: WebAPICompletion ) {
132+ public final func delete( path: String , queryItems: [ NSURLQueryItem ] ? = nil , completion: WebAPICompletion ) {
133133 execute ( path, queryItems: queryItems, method: . Delete, data: nil , completion: completion)
134134 }
135135
0 commit comments