mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 17:15:35 +00:00
Add ability to filter post data parameters
This commit is contained in:
committed by
Ivan Malison
parent
0dd7b05990
commit
0def349420
@@ -294,6 +294,15 @@ with my_vcr.use_cassette('test.yml', filter_query_parameters=['api_key']):
|
||||
requests.get('http://api.com/getdata?api_key=secretstring')
|
||||
```
|
||||
|
||||
### Filter information from HTTP post data
|
||||
Use the `filter_post_data_parameters` configuration option with a list of query
|
||||
parameters to filter.
|
||||
|
||||
```python
|
||||
with my_vcr.use_cassette('test.yml', filter_post_data_parameters=['client_secret']):
|
||||
requests.post('http://api.com/postdata', data={'api_key': 'secretstring'})
|
||||
```
|
||||
|
||||
### Custom Request filtering
|
||||
|
||||
If neither of these covers your request filtering needs, you can register a callback
|
||||
|
||||
Reference in New Issue
Block a user