-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow testing multipart PATCH requests #623
base: 2.5.x
Are you sure you want to change the base?
Conversation
Both POST and PUT methods allow users to pass in a list of files to perform a multipart/form-data request but it is missing from the PATCH methods.
@@ -94,10 +94,14 @@ trait Client extends ImplicitConversions { | |||
patch(uri, params)(f) | |||
def patch[A](uri: String, params: Iterable[(String, String)])(f: => A): A = | |||
patch(uri, params, Map[String, String]())(f) | |||
def patch[A](uri: String, params: Iterable[(String, String)], headers: Iterable[(String, String)])(f: => A): A = | |||
def patch[A](uri: String, params: Iterable[(String, String)], headers: Map[String, String])(f: => A): A = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one looks a change for a different purpose (consistency with POST/PUT ..). Although that is a breaking change but if there is no objection from others, I think it's ok to merge for 2.5.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, after adding the new method it wouldn't compile without this change. I think I was getting ambiguity error.
patch(uri, toQueryString(params).getBytes("UTF-8"), Seq("Content-Type" -> "application/x-www-form-urlencoded; charset=utf-8") ++ headers)(f) | ||
def patch[A](uri: String, body: Array[Byte] = Array(), headers: Iterable[(String, String)] = Seq.empty)(f: => A): A = | ||
submit("PATCH", uri, Seq.empty, headers, body) { f } | ||
def patch[A](uri: String, params: Iterable[(String, String)], files: Iterable[(String, Any)])(f: => A): A = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new methods look good to me.
Both POST and PUT methods allow users to pass in a list of files to perform a multipart/form-data request but it is missing from the PATCH methods.