getsentry / getsentry/responses

_recorder - matching http headers as well as URL

Open
#639 5 comments 0 reactions 1 assignee Claimed by @beliaev-maksim View on GitHub
enhancement
Dominant language
Python
Stars
4.3k
Forks
378
Avg merge
4d 1h
Merged PRs (30d)
1

Description

For my project, I need to mock responses from an API where some of the parameters are included in a HTTP header, so for example I would make a request to `http://api.com/projects` with a http header set to `user-id: joebloggs`

Currently I am recording the responses by doing:

```python
@_recorder.record(filepath="out.yaml")
def test_something():
...
```

and then I'm loading the yaml file like this:

```python
@responses.activate
def test_something():
responses.add_from_file("out.yaml")
...
```

Is it possible to set up the registry to match on this HTTP header, and also save this header in the .yaml files that it generates?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.