Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Handle Form Post #201

Closed
LotharMaerkle opened this issue Jul 6, 2021 · 1 comment · Fixed by #203
Closed

Handle Form Post #201

LotharMaerkle opened this issue Jul 6, 2021 · 1 comment · Fixed by #203
Assignees
Labels
enhancement New feature or request

Comments

@LotharMaerkle
Copy link

Still there are APIs out that requires body encoding application/x-www-form-urlencoded (consider mocking OIDC)

expressjs is configured to parse JSON, but not the form encoding
add export
const urlencodedBodyParser = express.urlencoded({ extended: true })
to middleware.js and apply in Server.js to the expressjs server

Describe alternatives you've considered
Not clear how to do that in a safe way through plugin as the expressjs is not exposed

@javierbrea
Copy link
Member

Hi @LotharMaerkle,

About the alternative you've considered, I think it's better to add it to the core instead of using a plugin. There is an issue about exposing some options to configure jsonBodyParser, so this new feature could be configurable with that options too. I will add a comment to mocks-server/main#251.

@javierbrea javierbrea added this to To do in mocks-server via automation Jul 7, 2021
@javierbrea javierbrea added the enhancement New feature or request label Jul 7, 2021
@javierbrea javierbrea moved this from To do to In progress in mocks-server Jul 7, 2021
javierbrea added a commit that referenced this issue Jul 7, 2021
mocks-server automation moved this from In progress to Done Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: Done
mocks-server
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants