0

I am trying to retrieve a JSON file, but it doesn't seem to be a JSON file, but it outputs application/json

12:39:39.403[main] DEBUG org.apache.http.wire - << "[0xb9][0x12][0x3d][0xr4][0xu6][0x43][0xd9][0x12][0xw3][0x43][0xb6][0x1q][0xef][0x13]"
12:39:39.403[main] DEBUG org.apache.http.wire - << "[0xwq][0xq2][0x9d][0x14][0xk6][0xw3][0x9q][0xz2][0xm3][0x4m][0xq6][0xkq][0xlf][0xq3]"
12:39:39.403[main] DEBUG org.apache.http.wire - << "30[\r][\n]"
12:39:39.403[main] DEBUG org.apache.http.wire - << "[0xb9][0x12][0x3d][0xr4][0xu6][0x43][0x9][0x12][0xw3][0x43][0xb6][0x1q][0xef][0x13]"

My rest assured code is

Response response = given().contentType(ContentType.JSON).auth().get("https://sample-url");

I would I like to see an actual JSON output

  • 1
    That doesn't look like the actual output - `0xr4` isn't a valid hex value. But without knowing what you're trying to get there is no way to help. Can you share the real URL or at least the first 10 real hex values? It seems likely that whatever service you're going against is *not* returning JSON. – stdunbar Sep 29 '20 at 20:02
  • `String response = given().contentType(ContentType.JSON).auth().get("https://sample-url").then().extract().response().asString()`; – Fenio Oct 02 '20 at 07:59

0 Answers0