americanexpress / nodes

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

ObjectMapper uses writeValueAsString() #112

Open ODie0x03B7 opened 4 years ago

ODie0x03B7 commented 4 years ago

In Fetch.java/send(...) ObjectMapper is invoked with writeValueAsString() and the string is immediately converted to bytes:

String requestParams = mapper.writeValueAsString(request);
byte[] postData = requestParams.getBytes();

This could be replaced by

byte[] postData = mapper.writeValueAsBytes(request);

if I understand correctly?