americanexpress / nodes

A GraphQL JVM Client - Java, Kotlin, Scala, etc.
Apache License 2.0
307 stars 70 forks source link

Exception when use gzip compression #102

Open IvanSaburov opened 4 years ago

IvanSaburov commented 4 years ago

I use io.aexp.nodes.graphql.nodes version: 0.5.0 for graphQL requests(java client). While I send requests without header Accept-Encoding = gzip it works fine. But if I add this header graphQLTemplate throws next exception: Exception in thread "main" GraphQLException{message='OK', status='200', description='Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens at [Source: (BufferedReader); line: 1, column: 2]', errors=null} at io.aexp.nodes.graphql.Fetch.send(Fetch.java:96) at io.aexp.nodes.graphql.GraphQLTemplate.execute(GraphQLTemplate.java:99) at io.aexp.nodes.graphql.GraphQLTemplate.query(GraphQLTemplate.java:58)

How I have to use gzip compression?