Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: In HTTP Feature Testing, delivering in body in application/json format #4362

Closed
ByeongUkChoi opened this issue Feb 27, 2021 · 3 comments

Comments

@ByeongUkChoi
Copy link
Contributor

Post in forum
https://forum.codeigniter.com/thread-77210.html

HTTP Feature Testing Dosc
https://codeigniter4.github.io/userguide/testing/feature.html#

// Submit a form
$result = $this->call('post', 'contact'), [
    'name' => 'Fred Flintstone',
    'email' => '[email protected]'
]);

It's only populated $_POST
We use "$request->getPost();"
But not working "$request->getJSON();"

What should I do to send JSON format in http feature testing?

@kenjis
Copy link
Member

kenjis commented Feb 28, 2021

@ByeongUkChoi
Copy link
Contributor Author

See https://codeigniter4.github.io/userguide/testing/feature.html#formatting-the-request.

I missed that part, Thanks, a lot :)

@kenjis
Copy link
Member

kenjis commented Mar 1, 2021

@ByeongUkChoi Nobody's perfect. ;-)

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

No branches or pull requests

2 participants