Skip to content

Commit

Permalink
Merge pull request Moya#1787 from pinddFull/update_md
Browse files Browse the repository at this point in the history
Update AlamofireValidation.md
  • Loading branch information
BasThomas authored Jan 11, 2019
2 parents b68e852 + 9932243 commit 3782f1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/Examples/AlamofireValidation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Alamofire automatic validation
Sometimes, you will want to use [Alamofire automatic validation](https://github.com/Alamofire/Alamofire#automatic-validation) for some requests.
Sometimes, you will want to use [Alamofire automatic validation](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#automatic-validation) for some requests.
When a request is configured with Alamofire validation, Moya will internally call Alamofire's `validate()` method on the concerned `DataRequest`.

```swift
Expand Down Expand Up @@ -44,7 +44,7 @@ You can choose from four cases:

The default validation type for all requests is `ValidationType.none`.

Alamofire automatic validation can be useful, for example if you want to use the [Alamofire's `RequestRetrier` and `RequestAdapter`](https://github.com/Alamofire/Alamofire#requestretrier), for an OAuth 2 ready Moya Client.
Alamofire automatic validation can be useful, for example if you want to use the [Alamofire's `RequestRetrier` and `RequestAdapter`](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#requestretrier), for an OAuth 2 ready Moya Client.

Also, if validation fails, you can get the response from the returned `MoyaError`.

Expand Down
4 changes: 2 additions & 2 deletions docs_CN/Examples/AlamofireValidation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Alamofire 自动验证

有时候, 您希望为某些请求使用 [Alamofire自动化验证](https://github.com/Alamofire/Alamofire#automatic-validation) .
有时候, 您希望为某些请求使用 [Alamofire自动化验证](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#automatic-validation) .
当你对请求配置了Alamofire 验证的时候, Moya会在相关联的`DataRequest`上,内部调用Alamofire的 `validate()` 方法。

```swift
Expand Down Expand Up @@ -45,7 +45,7 @@ Moya允许你通过`ValidationType`枚举配置Alamofire验证功能。

所有请求的默认配置都是`ValidationType.none`

如果你想在一个支持OAuth 2的Moya客户端中使用 [Alamofire的 `RequestRetrier``RequestAdapter`](https://github.com/Alamofire/Alamofire#requestretrier),Alamofire自动化验证会发挥非常大的作用。
如果你想在一个支持OAuth 2的Moya客户端中使用 [Alamofire的 `RequestRetrier``RequestAdapter`](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#requestretrier),Alamofire自动化验证会发挥非常大的作用。

同样地, 如果验证失败, 你会从返回的`MoyaError`中获取到一个响应。

Expand Down

0 comments on commit 3782f1f

Please sign in to comment.