title: Uploading Multipart Using Retrofit
body: <p>I am trying to upload a file (Audio File) to the server using Retrofit. 
  But i am getting </p>
  
  <blockquote>
    <p>failure: retrofit.RetrofitError: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $</p>
  </blockquote>
  
  <p>. though before, i used async tasks mutipartEntityBuilder and sent the file using httpPost successfuly. 
  Here is the client side code i am using. if you need any more info (server side) i will post it.</p>
  
  <p>thank you.</p>
  
  <pre><code>  @POST("/UploadImageFile")
      @Multipart
      void upload(@Part("file") TypedFile file,
                  @Part("Name") String Name,
                  @Part("Taskcode") String Taskcode,
                  @Part("ClientId") String ClientId,
                  @Part("Type") String Type,
                  Callback&lt;String&gt; cb);
  
   RestAdapter restAdapter = new RestAdapter.Builder()
                  .setEndpoint(BASE_URL)
                  .setClient(new OkClient(new OkHttpClient()))
                  .build();
  
          restAdapter.setLogLevel(RestAdapter.LogLevel.FULL);
          RestAPI post = restAdapter.create(RestAPI.class);
  
  
          TypedFile typedFile = new TypedFile("multipart/form-data", new File(Path));
          String NameOfFile = typedFile.fileName();
          post.upload(typedFile,NameOfFile, currentTaskCode,HTTPRequestUserAuthentication.AppID,Type,new Callback&lt;String&gt;() {
              @Override
              public void success(String s, Response response) {
                  Log.d(TAG,"Success: "+s);
              }
  
              @Override
              public void failure(RetrofitError error) {
                  Log.d(TAG,"failure: "+error.toString());
              }
          });
  </code></pre>