Решение:
Вместо:
int success;
в вашем классе Model, напишите это:
@SerializedName("success")
public int success;
Вот и все, надеюсь, это поможет.
Если вы получаете сообщение об ошибке 403, выполните следующие действия и попробуйте:
Шаг 1:
C: \ wamp64 \ Bin \ Apache \ apache2.4.23 \ конф
Шаг 2: внесите эти изменения
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options +Indexes +FollowSymLinks +Multiviews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
#onlineoffline tag - don't remove
Require all granted
Редактировать Не требовать до Требуется все предоставлено
2) Теперь перейдите к C:\wamp64\bin\apache\apache2.4.23\conf\extra\httpd-vhost.conf
и сделайте то же самое для виртуального хоста, определенного для localhost
AllowOverride All
Require all granted
Перезагрузите сервер, он должен работать
Если вы получаете ошибку Lenient, попробуйте:
implementation 'com.google.code.gson:gson:2.6.1'
Gson gson = new GsonBuilder()
.setLenient()
.create();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(insert_your_url)
.client(client)
.addConverterFactory(GsonConverterFactory.create(gson))
.build();
Проверьте пожалуйста.