eos-java-rpc-wrapper icon indicating copy to clipboard operation
eos-java-rpc-wrapper copied to clipboard

okhttp error end of stream

Open srmcatee1110 opened this issue 6 years ago • 1 comments

Caused by: java.io.EOFException: \n not found: limit=0 content=… at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:237) at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:215) at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)

The code: ` import client.EosApiClientFactory; import client.EosApiRestClient; import client.domain.response.chain.AbiJsonToBin;

import java.util.HashMap; import java.util.Map;

public class Main {

public static void main(String[] args) {

    EosApiRestClient eosApiRestClient;
    eosApiRestClient = EosApiClientFactory.newInstance("http://127.0.0.1:8888").newRestClient();

    //build payload
    Map<String, String> arg = new HashMap(4);
    arg.put("custacct", "consumer");
    arg.put("account", "fimulti");
    arg.put("name", "onboard");

    AbiJsonToBin data = eosApiRestClient.abiJsonToBin("currency", "transfer", arg);

`

srmcatee1110 avatar Dec 14 '18 00:12 srmcatee1110

You should add following items in pom.xml for initialize eos_api_rest_client

` <com.squareup.retrofit2.version>2.5.0</com.squareup.retrofit2.version> <converter-scalars.version>2.5.0</converter-scalars.version> <okhttp.version>3.12.0</okhttp.version>

com.squareup.okhttp3 okhttp ${okhttp.version} com.squareup.okhttp3 logging-interceptor ${okhttp.version} com.squareup.retrofit2 converter-scalars ${converter-scalars.version} com.squareup.retrofit2 retrofit ${com.squareup.retrofit2.version} `

Cavan2477 avatar Jun 20 '19 08:06 Cavan2477