Skip to content

Commit

Permalink
Add EmptyBody case (#186)
Browse files Browse the repository at this point in the history
An error occurs when using the following code.
```
ws.url(url).withRequestFilter(AhcCurlRequestLogger()).withQueryStringParameters("hey" -> "yo").get()
```
Prevent throw exception EmptyBody case.
  • Loading branch information
suya55 authored and marcospereira committed Aug 28, 2017
1 parent 7d26b36 commit ac202f4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import java.util.Base64
import org.slf4j.LoggerFactory
import play.api.libs.ws._
import play.shaded.ahc.org.asynchttpclient.util.HttpUtils

import play.api.libs.ws.EmptyBody
/**
* Logs WSRequest and pulls information into Curl format to an SLF4J logger.
*
Expand Down Expand Up @@ -76,6 +76,7 @@ trait CurlFormat {
// XXX Need to escape any quotes within the body of the string.
b.append(s" --data '${quote(bodyString)}'")
b.append(" \\\n")
case EmptyBody => // Do nothing.
case other =>
throw new UnsupportedOperationException("Unsupported body type " + other.getClass)
}
Expand Down

0 comments on commit ac202f4

Please sign in to comment.