S
S
Stanislav Nekrasov2019-08-19 13:04:22
Java
Stanislav Nekrasov, 2019-08-19 13:04:22

Why does the 414 error keep appearing?

Hello. I use Retrofit to send a picture and some data from an Android app to a server. (Server in Java. Tomcat). But it keeps returning error 414.

interface Api {
@POST("addevent")
    Call<Answer> addEvent(@Query("type") String type, @Query("photo") String photo,
                              @Query("worker_id") int workerId, @Query("company_id") int companyId, @Query("timestamp") long timestamp);
}

// Потом

retrofit = new Retrofit.Builder()
                .baseUrl(getString(R.string.IP) + getString(R.string.PORT) + "/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
        api = retrofit.create(Api.class);

Call<Answer> checkPinCode = api.addEvent(type, photo, workerId, companyId, timestamp);

checkPinCode.enqueue(new Callback<Answer>() {
// ...
}

The following settings are written on the server:
http {
large_client_header_buffers 4 16384k;
client_max_body_size 20m;
}

How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2019-08-19
@Metalofon

client_max_body_sizeIt has nothing to do with 414 error.
Without a traffic dump, diagnosing something is rather problematic, but offhand - it suggests sending data via POST, not GET.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question