Codeception / module-rest

REST module for Codeception
MIT License
53 stars 27 forks source link

REST modules sendPOST doesn't have any way to set body #9

Closed Pi-George closed 4 years ago

Pi-George commented 4 years ago

Simple curl to test login

curl 'http://pi.docker/security/login' --data 'email=noreply@intelligentpositioning.com' --data 'password=20password18'

Currently this is impossible to do from the REST module because you can only set "$params" from the send functions. As far as I can tell those $params are just GET params too which append to the url. So I'm unable to do something like the below to mimic curl:

$this->sendPOST(
    '/security/login',
    ['email' => 'noreply@intelligntpositioning.com', 'password' => '20password18']
);
Naktibalda commented 4 years ago

Are you sure? It should be working correctly. Which framework module or PhpBrowser do you use?

Pi-George commented 4 years ago

Sorry you're absolutely correct, it was caused by a typo in the email addresses, intellignt vs intelligent.

For some reason using ?XDEBUG_SESSION_START doesn't work through codeception so I was struggling to debug the reason.