【发布时间】:2018-09-04 15:08:48
【问题描述】:
我一直在关注在线教程,并仔细遵循以下代码作为 API 接口。我不断收到诸如非法类型开头之类的错误:
package com.gwiddle.airsoftcreations.airsoftapp;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface ApiInterface {
@GET("register.php")
Call<User> performRegistration(@Query("name") String Name,
@Query("user_name") String UserName, @Query("user_password") String UserPassword );
@GET("login.php")
Call<User>perfromUserLogin@Query("user_name") String Username,
@Query("user_password") String UserPassword)
}
请帮忙
【问题讨论】:
-
可能你不应该用大写字母命名你的变量。所以尝试将其重命名为 String userPassword、String username 等。因为在 java 中用于类名的大写字母,所以可能您的某些类具有名称 Username 例如。
-
关注此问题,以便其他人也能理解您的问题:stackoverflow.com/help/how-to-ask
-
你能链接到教程吗?它们是否还包含拼写错误?