Using scalaj.http 2.4 I cannot get the correct code for a If-None-Match etag for this simple call:
import scalaj.http.Http
object EtagTest extends App {
val firstResponse = Http("https://api.github.com/users/octocat/orgs")
// get correct etag ...
val response = Http("https://api.github.com/users/octocat/orgs").header("If-None-Match", "\"98f0c1b396a4e5d54f4d5fe561d54b44\"").asString
println(response.code)
}
I'm expecting a 304 Not Modified but I get a 200.
I tried the following and it worked for me. It looks like the
ETagyou get with this program is not theETagyou've hard coded in your program. The strange thing is that when I send a cURL request to it, theETagreturned is the one you have hard coded.Output of the above: