forked from KKKKKKKEM/bricks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(response.py): 优化Response类参数默认值及方法实现
在`Response`类中进行了以下修改: - 将`url`参数的默认值从`None`改为`""`,以提供更明确的空字符串作为默认值。 - 在`guess_encoding`方法中,当`self.content`为空时,返回默认编码"utf-8"而不是直接返回。 - 更新了`extract`方法中的`rules`参数,默认值设为`None`,并在方法内部处理为`{}`,以增强灵活性。 - 修改了`get`方法的文档说明,使其更加清晰地描述了使用`jmespath`进行匹配的功能,并调整了参数说明以更好地反映实际用途。 这些改动旨在提高代码的可读性和维护性。
- Loading branch information
Showing
1 changed file
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters