oh-my-mock icon indicating copy to clipboard operation
oh-my-mock copied to clipboard

Feature :I hope this tool can .......

Open 520f opened this issue 2 years ago • 1 comments

  • Adding, replacing and removing request headers.
  • Replacing the request body, text/JSON, Base64 or form data.

520f avatar Jul 14 '22 06:07 520f

This is indeed not possible. I have to investigate, but I think the only way this is possible is via the "Mocking with code" option

mocking-with-code

Then you can use FETCH like this

mocking-coe-fetch

At the moment using fetch will probably give you CORS errors because fetch is executed in a sandbox inside the chrome extension. The only way right now to fix this is to start you browser with web-security disabled. On mac the command looks like this

$> open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security

But that might not be all, because of this sandbox you might not have the required cookies. Cookie support is something I'm working on right now.

So, long story short, after cookie support I will try to fix this issue!

scaljeri avatar Jul 14 '22 10:07 scaljeri