Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在URL中获取附加了参数的请求使用改型_Android_Exception_Annotations_Httprequest_Retrofit2 - Fatal编程技术网

Android 在URL中获取附加了参数的请求使用改型

Android 在URL中获取附加了参数的请求使用改型,android,exception,annotations,httprequest,retrofit2,Android,Exception,Annotations,Httprequest,Retrofit2,如何在Android中使用改型在URL中发出HTTP GET请求,该URL的参数附加了& 网址: 目前,我正在使用: @GET("http://api.com?name={name}&class={class}") Call<CustomType> get( @Path(value = "name",encoded = false) String name, @Path(value = "class",encoded =

如何在Android中使用改型在URL中发出HTTP GET请求,该URL的参数附加了
&

网址:

目前,我正在使用:

@GET("http://api.com?name={name}&class={class}")
    Call<CustomType> get(
            @Path(value = "name",encoded = false) String name,
            @Path(value = "class",encoded = false) String class);

这是一个标准的GET请求url。只需使用
@Query

@GET("http://api.com")
Call<CustomType> get(
        @Query("name") String name,
        @Query("class") String classs);
@GET(“http://api.com")
呼叫获取(
@查询(“名称”)字符串名称,
@查询(“类”)字符串类;
它将访问url:
http://api.com?name=remote&class=TV

@GET("http://api.com")
Call<CustomType> get(
        @Query("name") String name,
        @Query("class") String classs);