EOSEssentials / eos-java-rpc-wrapper

http://www.eos42.io
MIT License
161 stars 76 forks source link

okhttp error end of stream #40

Open srmcatee1110 opened 5 years ago

srmcatee1110 commented 5 years ago

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);

`

Cavan2477 commented 5 years ago

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

`

2.5.0 2.5.0 3.12.0 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} `