I am accessing an api .which looks like
http://XXX.XX.XXX.XXX/api/Gallery/getgallerylist?userid="17"
.
I have tried the following annotation.
@POST("Gallery/getgallerylist")
Call<GalleryImagesResponse> getGalleryImages(@Query("userid") String userid);
But the url it requests is http://XXX.XX.XXX.XXX/api/Gallery/getgallerylist?userid=17
So that how can I add double quote to userid's value like userid="17".
You can pass the string as @Path
to the URL like this.
@POST("http://XXX.XX.XXX.XXX/api/Gallery/getgallerylist?" + "{path}")
Call<ResponseBody> getGalleryImages(@Path("path") String path);
and pass userid=17
to this call, it will append to the URL. and your done
您应该在点击
url
之前尝试一下
URLDecoder.decode(url,UTF8);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.