@@ -83,13 +83,15 @@ object RequestBlob {
8383 s.contentLength.map(" Content-Length" -> _.toString)
8484 def write (out : java.io.OutputStream ) = s.writeBytesTo(out)
8585 }
86+
8687 implicit class FileRequestBlob (x : java.io.File ) extends RequestBlob {
8788 override def headers = super .headers ++ Seq (
8889 " Content-Type" -> " application/octet-stream" ,
8990 " Content-Length" -> x.length().toString,
9091 )
9192 def write (out : java.io.OutputStream ) = Util .transferTo(new FileInputStream (x), out)
9293 }
94+
9395 implicit class NioFileRequestBlob (x : java.nio.file.Path ) extends RequestBlob {
9496 override def headers = super .headers ++ Seq (
9597 " Content-Type" -> " application/octet-stream" ,
@@ -101,9 +103,8 @@ object RequestBlob {
101103
102104 implicit class FormEncodedRequestBlob (val x : Iterable [(String , String )]) extends RequestBlob {
103105 val serialized = Util .urlEncode(x).getBytes
104- override def headers = super .headers ++ Seq (
105- " Content-Type" -> " application/x-www-form-urlencoded" ,
106- )
106+ override def headers =
107+ super .headers ++ Seq (" Content-Type" -> " application/x-www-form-urlencoded" )
107108 def write (out : java.io.OutputStream ) = {
108109 out.write(serialized)
109110 }
@@ -262,7 +263,9 @@ object RequestAuth {
262263 object Empty extends RequestAuth {
263264 def header = None
264265 }
266+
265267 implicit def implicitBasic (x : (String , String )): Basic = new Basic (x._1, x._2)
268+
266269 class Basic (username : String , password : String ) extends RequestAuth {
267270 def header = Some (
268271 " Basic " + java.util.Base64 .getEncoder.encodeToString((username + " :" + password).getBytes()),
0 commit comments