@@ -16,32 +16,32 @@ public struct Request<Output> {
1616 public let path : String
1717 public let method : Method
1818 public let body : Encodable ?
19- public let parameters : [ String : String ]
19+ public let query : [ String : QueryParam ]
2020 public private( set) var headers : HTTPHeaderFields = [ : ]
2121
22- public static func get( _ path: Path , parameters : [ String : String ] = [ : ] ) -> Self {
23- self . init ( path: path, method: . get, parameters : parameters , body: nil )
22+ public static func get( _ path: Path , query : [ String : QueryParam ] = [ : ] ) -> Self {
23+ self . init ( path: path, method: . get, query : query , body: nil )
2424 }
2525
26- public static func post( _ path: Path , body: Encodable ? , parameters : [ String : String ] = [ : ] )
26+ public static func post( _ path: Path , body: Encodable ? , query : [ String : QueryParam ] = [ : ] )
2727 -> Self {
28- self . init ( path: path, method: . post, parameters : parameters , body: body)
28+ self . init ( path: path, method: . post, query : query , body: body)
2929 }
3030
31- public static func put( _ path: Path , body: Encodable , parameters : [ String : String ] = [ : ] )
31+ public static func put( _ path: Path , body: Encodable , query : [ String : QueryParam ] = [ : ] )
3232 -> Self {
33- self . init ( path: path, method: . put, parameters : parameters , body: body)
33+ self . init ( path: path, method: . put, query : query , body: body)
3434 }
3535
36- public static func delete( _ path: Path , parameters : [ String : String ] = [ : ] ) -> Self {
37- self . init ( path: path, method: . delete, parameters : parameters , body: nil )
36+ public static func delete( _ path: Path , query : [ String : QueryParam ] = [ : ] ) -> Self {
37+ self . init ( path: path, method: . delete, query : query , body: nil )
3838 }
3939
40- private init ( path: Path , method: Method , parameters : [ String : String ] = [ : ] , body: Encodable ? ) {
40+ private init ( path: Path , method: Method , query : [ String : QueryParam ] , body: Encodable ? ) {
4141 self . path = path. path
4242 self . method = method
4343 self . body = body
44- self . parameters = parameters
44+ self . query = query
4545 }
4646
4747 /// add headers to the request
0 commit comments