1
0
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:
Edward Stone
2015-03-30 22:30:03 -07:00
committed by Ivan Malison
parent 0dd7b05990
commit 0def349420
5 changed files with 79 additions and 3 deletions

View File

@@ -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