Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wd1105040417
retrofit
提交
39e5666d
R
retrofit
项目概览
wd1105040417
/
retrofit
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
retrofit
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
39e5666d
编写于
4月 05, 2016
作者:
J
Jake Wharton
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Correct rendering of '@' in Javadoc.
上级
471a12ee
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
46 addition
and
56 deletion
+46
-56
retrofit-adapters/guava/src/main/java/retrofit2/adapter/guava/GuavaCallAdapterFactory.java
...java/retrofit2/adapter/guava/GuavaCallAdapterFactory.java
+2
-2
retrofit-adapters/java8/src/main/java/retrofit2/adapter/java8/Java8CallAdapterFactory.java
...java/retrofit2/adapter/java8/Java8CallAdapterFactory.java
+2
-2
retrofit-adapters/rxjava/src/main/java/retrofit2/adapter/rxjava/RxJavaCallAdapterFactory.java
...va/retrofit2/adapter/rxjava/RxJavaCallAdapterFactory.java
+2
-2
retrofit/src/main/java/retrofit2/CallAdapter.java
retrofit/src/main/java/retrofit2/CallAdapter.java
+2
-2
retrofit/src/main/java/retrofit2/Retrofit.java
retrofit/src/main/java/retrofit2/Retrofit.java
+2
-2
retrofit/src/main/java/retrofit2/http/Body.java
retrofit/src/main/java/retrofit2/http/Body.java
+0
-2
retrofit/src/main/java/retrofit2/http/Field.java
retrofit/src/main/java/retrofit2/http/Field.java
+4
-4
retrofit/src/main/java/retrofit2/http/FieldMap.java
retrofit/src/main/java/retrofit2/http/FieldMap.java
+2
-2
retrofit/src/main/java/retrofit2/http/HTTP.java
retrofit/src/main/java/retrofit2/http/HTTP.java
+4
-4
retrofit/src/main/java/retrofit2/http/Header.java
retrofit/src/main/java/retrofit2/http/Header.java
+2
-6
retrofit/src/main/java/retrofit2/http/Headers.java
retrofit/src/main/java/retrofit2/http/Headers.java
+2
-6
retrofit/src/main/java/retrofit2/http/Part.java
retrofit/src/main/java/retrofit2/http/Part.java
+2
-2
retrofit/src/main/java/retrofit2/http/PartMap.java
retrofit/src/main/java/retrofit2/http/PartMap.java
+2
-2
retrofit/src/main/java/retrofit2/http/Path.java
retrofit/src/main/java/retrofit2/http/Path.java
+4
-4
retrofit/src/main/java/retrofit2/http/Query.java
retrofit/src/main/java/retrofit2/http/Query.java
+8
-8
retrofit/src/main/java/retrofit2/http/QueryMap.java
retrofit/src/main/java/retrofit2/http/QueryMap.java
+4
-4
retrofit/src/main/java/retrofit2/http/Url.java
retrofit/src/main/java/retrofit2/http/Url.java
+2
-2
未找到文件。
retrofit-adapters/guava/src/main/java/retrofit2/adapter/guava/GuavaCallAdapterFactory.java
浏览文件 @
39e5666d
...
@@ -32,12 +32,12 @@ import retrofit2.Retrofit;
...
@@ -32,12 +32,12 @@ import retrofit2.Retrofit;
* <p>
* <p>
* Adding this class to {@link Retrofit} allows you to return {@link ListenableFuture} from service
* Adding this class to {@link Retrofit} allows you to return {@link ListenableFuture} from service
* methods.
* methods.
* <pre>
{@code
* <pre>
<code>
* interface MyService {
* interface MyService {
* @GET("user/me")
* @GET("user/me")
* ListenableFuture<User> getUser()
* ListenableFuture<User> getUser()
* }
* }
*
}
</pre>
*
</code>
</pre>
* There are two configurations supported for the {@code ListenableFuture} type parameter:
* There are two configurations supported for the {@code ListenableFuture} type parameter:
* <ul>
* <ul>
* <li>Direct body (e.g., {@code ListenableFuture<User>}) returns the deserialized body for 2XX
* <li>Direct body (e.g., {@code ListenableFuture<User>}) returns the deserialized body for 2XX
...
...
retrofit-adapters/java8/src/main/java/retrofit2/adapter/java8/Java8CallAdapterFactory.java
浏览文件 @
39e5666d
...
@@ -31,12 +31,12 @@ import retrofit2.Retrofit;
...
@@ -31,12 +31,12 @@ import retrofit2.Retrofit;
* <p>
* <p>
* Adding this class to {@link Retrofit} allows you to return {@link CompletableFuture} from
* Adding this class to {@link Retrofit} allows you to return {@link CompletableFuture} from
* service methods.
* service methods.
* <pre>
{@code
* <pre>
<code>
* interface MyService {
* interface MyService {
* @GET("user/me")
* @GET("user/me")
* CompletableFuture<User> getUser()
* CompletableFuture<User> getUser()
* }
* }
*
}
</pre>
*
</code>
</pre>
* There are two configurations supported for the {@code CompletableFuture} type parameter:
* There are two configurations supported for the {@code CompletableFuture} type parameter:
* <ul>
* <ul>
* <li>Direct body (e.g., {@code CompletableFuture<User>}) returns the deserialized body for 2XX
* <li>Direct body (e.g., {@code CompletableFuture<User>}) returns the deserialized body for 2XX
...
...
retrofit-adapters/rxjava/src/main/java/retrofit2/adapter/rxjava/RxJavaCallAdapterFactory.java
浏览文件 @
39e5666d
...
@@ -37,12 +37,12 @@ import rx.functions.Func1;
...
@@ -37,12 +37,12 @@ import rx.functions.Func1;
* <p>
* <p>
* Adding this class to {@link Retrofit} allows you to return {@link Observable} from service
* Adding this class to {@link Retrofit} allows you to return {@link Observable} from service
* methods.
* methods.
* <pre>
{@code
* <pre>
<code>
* interface MyService {
* interface MyService {
* @GET("user/me")
* @GET("user/me")
* Observable<User> getUser()
* Observable<User> getUser()
* }
* }
*
}
</pre>
*
</code>
</pre>
* There are three configurations supported for the {@code Observable} type parameter:
* There are three configurations supported for the {@code Observable} type parameter:
* <ul>
* <ul>
* <li>Direct body (e.g., {@code Observable<User>}) calls {@code onNext} with the deserialized body
* <li>Direct body (e.g., {@code Observable<User>}) calls {@code onNext} with the deserialized body
...
...
retrofit/src/main/java/retrofit2/CallAdapter.java
浏览文件 @
39e5666d
...
@@ -40,7 +40,7 @@ public interface CallAdapter<T> {
...
@@ -40,7 +40,7 @@ public interface CallAdapter<T> {
* <p>
* <p>
* For example, given an instance for a hypothetical utility, {@code Async}, this instance would
* For example, given an instance for a hypothetical utility, {@code Async}, this instance would
* return a new {@code Async<R>} which invoked {@code call} when run.
* return a new {@code Async<R>} which invoked {@code call} when run.
* <pre>
{@code
* <pre>
<code>
* @Override
* @Override
* public <R> Async<R> adapt(final Call<R> call) {
* public <R> Async<R> adapt(final Call<R> call) {
* return Async.create(new Callable<Response<R>>() {
* return Async.create(new Callable<Response<R>>() {
...
@@ -50,7 +50,7 @@ public interface CallAdapter<T> {
...
@@ -50,7 +50,7 @@ public interface CallAdapter<T> {
* }
* }
* });
* });
* }
* }
*
}
</pre>
*
</code>
</pre>
*/
*/
<
R
>
T
adapt
(
Call
<
R
>
call
);
<
R
>
T
adapt
(
Call
<
R
>
call
);
...
...
retrofit/src/main/java/retrofit2/Retrofit.java
浏览文件 @
39e5666d
...
@@ -43,7 +43,7 @@ import static retrofit2.Utils.checkNotNull;
...
@@ -43,7 +43,7 @@ import static retrofit2.Utils.checkNotNull;
* the builder} and pass your interface to {@link #create} to generate an implementation.
* the builder} and pass your interface to {@link #create} to generate an implementation.
* <p>
* <p>
* For example,
* For example,
* <pre>
{@code
* <pre>
<code>
* Retrofit retrofit = new Retrofit.Builder()
* Retrofit retrofit = new Retrofit.Builder()
* .baseUrl("https://api.example.com/")
* .baseUrl("https://api.example.com/")
* .addConverterFactory(GsonConverterFactory.create())
* .addConverterFactory(GsonConverterFactory.create())
...
@@ -51,7 +51,7 @@ import static retrofit2.Utils.checkNotNull;
...
@@ -51,7 +51,7 @@ import static retrofit2.Utils.checkNotNull;
*
*
* MyApi api = retrofit.create(MyApi.class);
* MyApi api = retrofit.create(MyApi.class);
* Response<User> user = api.getUser().execute();
* Response<User> user = api.getUser().execute();
*
}
</pre>
*
</code>
</pre>
*
*
* @author Bob Lee (bob@squareup.com)
* @author Bob Lee (bob@squareup.com)
* @author Jake Wharton (jw@squareup.com)
* @author Jake Wharton (jw@squareup.com)
...
...
retrofit/src/main/java/retrofit2/http/Body.java
浏览文件 @
39e5666d
...
@@ -32,8 +32,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -32,8 +32,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* request body.
* request body.
* <p>
* <p>
* Body parameters may not be {@code null}.
* Body parameters may not be {@code null}.
*
* @author Eric Denman (edenman@squareup.com)
*/
*/
@Documented
@Documented
@Target
(
PARAMETER
)
@Target
(
PARAMETER
)
...
...
retrofit/src/main/java/retrofit2/http/Field.java
浏览文件 @
39e5666d
...
@@ -30,22 +30,22 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -30,22 +30,22 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* field pair for each non-{@code null} item.
* field pair for each non-{@code null} item.
* <p>
* <p>
* Simple Example:
* Simple Example:
* <pre>
{@code
* <pre>
<code>
* @FormUrlEncoded
* @FormUrlEncoded
* @POST("/")
* @POST("/")
* Call<ResponseBody> example(
* Call<ResponseBody> example(
* @Field("name") String name,
* @Field("name") String name,
* @Field("occupation") String occupation);
* @Field("occupation") String occupation);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.example("Bob Smith", "President")} yields a request body of
* Calling with {@code foo.example("Bob Smith", "President")} yields a request body of
* {@code name=Bob+Smith&occupation=President}.
* {@code name=Bob+Smith&occupation=President}.
* <p>
* <p>
* Array/Varargs Example:
* Array/Varargs Example:
* <pre>
{@code
* <pre>
<code>
* @FormUrlEncoded
* @FormUrlEncoded
* @POST("/list")
* @POST("/list")
* Call<ResponseBody> example(@Field("name") String... names);
* Call<ResponseBody> example(@Field("name") String... names);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.example("Bob Smith", "Jane Doe")} yields a request body of
* Calling with {@code foo.example("Bob Smith", "Jane Doe")} yields a request body of
* {@code name=Bob+Smith&name=Jane+Doe}.
* {@code name=Bob+Smith&name=Jane+Doe}.
*
*
...
...
retrofit/src/main/java/retrofit2/http/FieldMap.java
浏览文件 @
39e5666d
...
@@ -26,11 +26,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -26,11 +26,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* Named key/value pairs for a form-encoded request.
* Named key/value pairs for a form-encoded request.
* <p>
* <p>
* Simple Example:
* Simple Example:
* <pre>
{@code
* <pre>
<code>
* @FormUrlEncoded
* @FormUrlEncoded
* @POST("/things")
* @POST("/things")
* Call<ResponseBody> things(@FieldMap Map<String, String> fields);
* Call<ResponseBody> things(@FieldMap Map<String, String> fields);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.things(ImmutableMap.of("foo", "bar", "kit", "kat")} yields a request
* Calling with {@code foo.things(ImmutableMap.of("foo", "bar", "kit", "kat")} yields a request
* body of {@code foo=bar&kit=kat}.
* body of {@code foo=bar&kit=kat}.
* <p>
* <p>
...
...
retrofit/src/main/java/retrofit2/http/HTTP.java
浏览文件 @
39e5666d
...
@@ -25,19 +25,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -25,19 +25,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
/**
* Use a custom HTTP verb for a request.
* Use a custom HTTP verb for a request.
* <pre>
{@code
* <pre>
<code>
* interface Service {
* interface Service {
* @HTTP(method = "CUSTOM", path = "custom/endpoint/")
* @HTTP(method = "CUSTOM", path = "custom/endpoint/")
* Call<ResponseBody> customEndpoint();
* Call<ResponseBody> customEndpoint();
* }
* }
*
}
</pre>
*
</code>
</pre>
* This annotation can also used for sending {@code DELETE} with a request body:
* This annotation can also used for sending {@code DELETE} with a request body:
* <pre>
{@code
* <pre>
<code>
* interface Service {
* interface Service {
* @HTTP(method = "DELETE", path = "remove/", hasBody = true)
* @HTTP(method = "DELETE", path = "remove/", hasBody = true)
* Call<ResponseBody> deleteObject(@Body RequestBody object);
* Call<ResponseBody> deleteObject(@Body RequestBody object);
* }
* }
*
}
</pre>
*
</code>
</pre>
*/
*/
@Documented
@Documented
@Target
(
METHOD
)
@Target
(
METHOD
)
...
...
retrofit/src/main/java/retrofit2/http/Header.java
浏览文件 @
39e5666d
...
@@ -24,19 +24,15 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -24,19 +24,15 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
/**
* Replaces the header with the value of its target.
* Replaces the header with the value of its target.
* <p>
* <pre><code>
* <pre>{@code
* @GET("/")
* @GET("/")
* Call<ResponseBody> foo(@Header("Accept-Language") String lang);
* Call<ResponseBody> foo(@Header("Accept-Language") String lang);
* }</pre>
* </code></pre>
* <p>
* Header parameters may be {@code null} which will omit them from the request. Passing a
* Header parameters may be {@code null} which will omit them from the request. Passing a
* {@link java.util.List List} or array will result in a header for each non-{@code null} item.
* {@link java.util.List List} or array will result in a header for each non-{@code null} item.
* <p>
* <p>
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* be included in the request.
* be included in the request.
*
* @author Adrian Cole (adrianc@netflix.com)
*/
*/
@Documented
@Documented
@Retention
(
RUNTIME
)
@Retention
(
RUNTIME
)
...
...
retrofit/src/main/java/retrofit2/http/Headers.java
浏览文件 @
39e5666d
...
@@ -24,8 +24,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -24,8 +24,7 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
/**
* Adds headers literally supplied in the {@code value}.
* Adds headers literally supplied in the {@code value}.
* <p>
* <pre><code>
* <pre>{@code
* @Headers("Cache-Control: max-age=640000")
* @Headers("Cache-Control: max-age=640000")
* @GET("/")
* @GET("/")
* ...
* ...
...
@@ -36,12 +35,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -36,12 +35,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* })
* })
* @GET("/")
* @GET("/")
* ...
* ...
* }</pre>
* </code></pre>
* <p>
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* <strong>Note:</strong> Headers do not overwrite each other. All headers with the same name will
* be included in the request.
* be included in the request.
*
* @author Adrian Cole (adrianc@netflix.com)
*/
*/
@Documented
@Documented
@Target
(
METHOD
)
@Target
(
METHOD
)
...
...
retrofit/src/main/java/retrofit2/http/Part.java
浏览文件 @
39e5666d
...
@@ -40,13 +40,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -40,13 +40,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* <p>
* <p>
* Values may be {@code null} which will omit them from the request body.
* Values may be {@code null} which will omit them from the request body.
* <p>
* <p>
* <pre>
{@code
* <pre>
<code>
* @Multipart
* @Multipart
* @POST("/")
* @POST("/")
* Call<ResponseBody> example(
* Call<ResponseBody> example(
* @Part("description") String description,
* @Part("description") String description,
* @Part(value = "image", encoding = "8-bit") RequestBody image);
* @Part(value = "image", encoding = "8-bit") RequestBody image);
*
}
</pre>
*
</code>
</pre>
* <p>
* <p>
* Part parameters may not be {@code null}.
* Part parameters may not be {@code null}.
*/
*/
...
...
retrofit/src/main/java/retrofit2/http/PartMap.java
浏览文件 @
39e5666d
...
@@ -34,13 +34,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -34,13 +34,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* {@linkplain Converter a converter}.</li>
* {@linkplain Converter a converter}.</li>
* </ul>
* </ul>
* <p>
* <p>
* <pre>
{@code
* <pre>
<code>
* @Multipart
* @Multipart
* @POST("/upload")
* @POST("/upload")
* Call<ResponseBody> upload(
* Call<ResponseBody> upload(
* @Part("file") RequestBody file,
* @Part("file") RequestBody file,
* @PartMap Map<String, RequestBody> params);
* @PartMap Map<String, RequestBody> params);
*
}
</pre>
*
</code>
</pre>
* <p>
* <p>
* A {@code null} value for the map, as a key, or as a value is not allowed.
* A {@code null} value for the map, as a key, or as a value is not allowed.
*
*
...
...
retrofit/src/main/java/retrofit2/http/Path.java
浏览文件 @
39e5666d
...
@@ -27,20 +27,20 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -27,20 +27,20 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* {@link String#valueOf(Object)} and URL encoded.
* {@link String#valueOf(Object)} and URL encoded.
* <p>
* <p>
* Simple example:
* Simple example:
* <pre>
{@code
* <pre>
<code>
* @GET("/image/{id}")
* @GET("/image/{id}")
* Call<ResponseBody> example(@Path("id") int id);
* Call<ResponseBody> example(@Path("id") int id);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.example(1)} yields {@code /image/1}.
* Calling with {@code foo.example(1)} yields {@code /image/1}.
* <p>
* <p>
* Values are URL encoded by default. Disable with {@code encoded=true}.
* Values are URL encoded by default. Disable with {@code encoded=true}.
* <pre>
{@code
* <pre>
<code>
* @GET("/user/{name}")
* @GET("/user/{name}")
* Call<ResponseBody> encoded(@Path("name") String name);
* Call<ResponseBody> encoded(@Path("name") String name);
*
*
* @GET("/user/{name}")
* @GET("/user/{name}")
* Call<ResponseBody> notEncoded(@Path(value="name", encoded=true) String name);
* Call<ResponseBody> notEncoded(@Path(value="name", encoded=true) String name);
*
}
</pre>
*
</code>
</pre>
* Calling {@code foo.encoded("John+Doe")} yields {@code /user/John%2BDoe} whereas
* Calling {@code foo.encoded("John+Doe")} yields {@code /user/John%2BDoe} whereas
* {@code foo.notEncoded("John+Doe")} yields {@code /user/John+Doe}.
* {@code foo.notEncoded("John+Doe")} yields {@code /user/John+Doe}.
* <p>
* <p>
...
...
retrofit/src/main/java/retrofit2/http/Query.java
浏览文件 @
39e5666d
...
@@ -30,33 +30,33 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -30,33 +30,33 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* query parameter for each non-{@code null} item.
* query parameter for each non-{@code null} item.
* <p>
* <p>
* Simple Example:
* Simple Example:
* <pre>
{@code
* <pre>
<code>
* @GET("/list")
* @GET("/list")
* Call<ResponseBody> list(@Query("page") int page);
* Call<ResponseBody> list(@Query("page") int page);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.list(1)} yields {@code /list?page=1}.
* Calling with {@code foo.list(1)} yields {@code /list?page=1}.
* <p>
* <p>
* Example with {@code null}:
* Example with {@code null}:
* <pre>
{@code
* <pre>
<code>
* @GET("/list")
* @GET("/list")
* Call<ResponseBody> list(@Query("category") String category);
* Call<ResponseBody> list(@Query("category") String category);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.list(null)} yields {@code /list}.
* Calling with {@code foo.list(null)} yields {@code /list}.
* <p>
* <p>
* Array/Varargs Example:
* Array/Varargs Example:
* <pre>
{@code
* <pre>
<code>
* @GET("/list")
* @GET("/list")
* Call<ResponseBody> list(@Query("category") String... categories);
* Call<ResponseBody> list(@Query("category") String... categories);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.list("bar", "baz")} yields
* Calling with {@code foo.list("bar", "baz")} yields
* {@code /list?category=bar&category=baz}.
* {@code /list?category=bar&category=baz}.
* <p>
* <p>
* Parameter names and values are URL encoded by default. Specify {@link #encoded() encoded=true}
* Parameter names and values are URL encoded by default. Specify {@link #encoded() encoded=true}
* to change this behavior.
* to change this behavior.
* <pre>
{@code
* <pre>
<code>
* @GET("/search")
* @GET("/search")
* Call<ResponseBody> list(@Query(value="foo", encoded=true) String foo);
* Call<ResponseBody> list(@Query(value="foo", encoded=true) String foo);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.list("foo+bar"))} yields {@code /search?foo=foo+bar}.
* Calling with {@code foo.list("foo+bar"))} yields {@code /search?foo=foo+bar}.
*
*
* @see QueryMap
* @see QueryMap
...
...
retrofit/src/main/java/retrofit2/http/QueryMap.java
浏览文件 @
39e5666d
...
@@ -28,19 +28,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -28,19 +28,19 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* Both keys and values are converted to strings using {@link String#valueOf(Object)}.
* Both keys and values are converted to strings using {@link String#valueOf(Object)}.
* <p>
* <p>
* Simple Example:
* Simple Example:
* <pre>
{@code
* <pre>
<code>
* @GET("/search")
* @GET("/search")
* Call<ResponseBody> list(@QueryMap Map<String, String> filters);
* Call<ResponseBody> list(@QueryMap Map<String, String> filters);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.list(ImmutableMap.of("foo", "bar", "kit", "kat"))} yields
* Calling with {@code foo.list(ImmutableMap.of("foo", "bar", "kit", "kat"))} yields
* {@code /search?foo=bar&kit=kat}.
* {@code /search?foo=bar&kit=kat}.
* <p>
* <p>
* Map keys and values representing parameter values are URL encoded by default. Specify
* Map keys and values representing parameter values are URL encoded by default. Specify
* {@link #encoded() encoded=true} to change this behavior.
* {@link #encoded() encoded=true} to change this behavior.
* <pre>
{@code
* <pre>
<code>
* @GET("/search")
* @GET("/search")
* Call<ResponseBody> list(@QueryMap(encoded=true) Map<String, String> filters);
* Call<ResponseBody> list(@QueryMap(encoded=true) Map<String, String> filters);
*
}
</pre>
*
</code>
</pre>
* Calling with {@code foo.list(ImmutableMap.of("foo", "foo+bar"))} yields
* Calling with {@code foo.list(ImmutableMap.of("foo", "foo+bar"))} yields
* {@code /search?foo=foo+bar}.
* {@code /search?foo=foo+bar}.
* <p>
* <p>
...
...
retrofit/src/main/java/retrofit2/http/Url.java
浏览文件 @
39e5666d
...
@@ -26,10 +26,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
...
@@ -26,10 +26,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
/**
* URL resolved against the {@linkplain Retrofit#baseUrl() base URL}.
* URL resolved against the {@linkplain Retrofit#baseUrl() base URL}.
* <pre>
{@code
* <pre>
<code>
* @GET
* @GET
* Call<ResponseBody> list(@Url String url);
* Call<ResponseBody> list(@Url String url);
*
}
</pre>
*
</code>
</pre>
* <p>
* <p>
* See {@linkplain retrofit2.Retrofit.Builder#baseUrl(HttpUrl) base URL} for details of how
* See {@linkplain retrofit2.Retrofit.Builder#baseUrl(HttpUrl) base URL} for details of how
* the value will be resolved against a base URL to create the full endpoint URL.
* the value will be resolved against a base URL to create the full endpoint URL.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录