Skip to content

Commit

Permalink
修正帮助文档中对于请求头相关的描述
Browse files Browse the repository at this point in the history
  • Loading branch information
getActivity committed Feb 13, 2025
1 parent 167f6b9 commit a0e18e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions HelpDoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ public final class XxxApi implements IRequestApi {

#### 如何传入动态的请求头

* 定义一个字段,并在上面添加 `@HTTPHeader` 注解即可
* 传入一个 `HashMap` 类型的字段,并在上面添加 `@HTTPHeader` 注解即可

```java
public final class XxxApi implements IRequestApi {
Expand All @@ -1094,14 +1094,14 @@ public final class XxxApi implements IRequestApi {
return "xxx/xxxx";
}

@HttpHeader
private String time;
@HTTPHeader
private HashMap<String,String> headers;
}
```

#### 如何重命名参数或者请求头的名称

* 传入一个 HashMap 类型的字段,并在上面添加 `@HTTPHeader` 注解即可
* 给字段加上 `@HttpRename` 注解即可,则可以修改参数名的值,如果没有加上此注解,则框架默认使用字段名作为参数名

```java
public final class XxxApi implements IRequestApi {
Expand All @@ -1112,8 +1112,8 @@ public final class XxxApi implements IRequestApi {
return "xxx/xxxx";
}

@HTTPHeader
private HashMap<String,String> headers;
@HttpRename("k")
private String keyword;
}
```

Expand Down

0 comments on commit a0e18e6

Please sign in to comment.