EOF exception while trying to upload images to server in retrofit 2.0.2
<p>I am getting an IO Exception while trying to upload image to server using retrofit 2.0.2 and okhttp 3.2.0</p>

<pre><code>at okhttp3.internal.http.Http1xStream.readResponse(Http1xStream.java:199                                                                              at okhttp3.internal.http.Http1xStream.readResponseHeaders(Http1xStream.java:125)                                                                                  at okhttp3.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:723)                                                                          at okhttp3.internal.http.HttpEngine.access$200(HttpEngine.java:81)                                                                              at okhttp3.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:708)                                                                                                                                                          at okhttp3.internal.http.HttpEngine.readResponse(HttpEngine.java:563)                                                                                                                                                          at okhttp3.RealCall.getResponse(RealCall.java:241)                                                                                                                                                          at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198)                                                                                                                                                         at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:203)                                                                                                                                                          at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:187)                                                                                                                                                         at com.palaverplace.palaverplace.controller.api.RetrofitBase$1.intercept(RetrofitBase.java:74)                                                                                                                                                          at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:187)                                                                                                                                                          at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160)
                                                                                                                                                     at okhttp3.RealCall.access$100(RealCall.java:30)
                                                                                                                                                      at okhttp3.RealCall$AsyncCall.execute(RealCall.java:127)
                                                                                                                                                      at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
                                                                                                                                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                                                                                                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                                                                                                      at java.lang.Thread.run(Thread.java:818)
                                                                                                                                                   Caused by: java.io.EOFException: \n not found: size=0 content=...
                                                                                                                                                      at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:201)
                                                                                                                                                      at okhttp3.internal.http.Http1xStream.readResponse
</code></pre>

<p>I used</p>

<pre><code>@Multipart
    @PUT("/common/imageUpload")
    Call&lt;Base&gt; updateProfPic(@QueryMap HashMap&lt;String,String&gt; requestBody, @Part("image_file") RequestBody file);
</code></pre>

<p>And in the request class</p>

<pre><code> MediaType MEDIA_TYPE_PNG = MediaType.parse("image/png");
        File file = new File(filePath);
        RequestBody requestBody = RequestBody.create(MEDIA_TYPE_PNG, file);


        HashMap&lt;String,String&gt; map = new HashMap&lt;&gt;();
        map.put("key1",value1);
        map.put("key2",value2);
        map.put("key3",value3);

        Call&lt;Base&gt; call = RetrofitBase.getRetrofitInstance(token).updatePic(map,requestBody);
</code></pre>

<p>What may be the issue </p>