Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

我看了你的demo,能mock响应体和响应头,但是怎么mockjson格式的响应体,我用json格式报错,只能用str #707

Open
liweihaha opened this issue Sep 5, 2023 · 0 comments

Comments

@liweihaha
Copy link

def interceptor(request):
if request.url == 'https://www.baidu.com':
request.create_response(
status_code=200,
headers={'Content-Type': 'application/json'}, # Optional headers dictionary
body={'ceshi': '1111'}
)
这样写会直接报错,please help me ,thinks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant