Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Module Rest Laravel Package

codeception/module-rest

REST module for Codeception that simplifies testing REST/JSON APIs: send HTTP requests, set headers/auth, validate response codes, formats, and payloads, and assert JSON/XML content. Integrates with other Codeception modules for end-to-end API tests.

View on GitHub
Deep Wiki
Context7
3.4.2

What's Changed

New Contributors

Full Changelog: https://github.com/Codeception/module-rest/compare/3.4.1...3.4.2

3.4.1

What's Changed

New Contributors

Full Changelog: https://github.com/Codeception/module-rest/compare/3.4.0...3.4.1

3.4.0

What's Changed

New Contributors

Full Changelog: https://github.com/Codeception/module-rest/compare/3.3.2...3.4.0

2.0.3
  • Support softcreatr/jsonpath ^0.8
3.3.2
  • Reverted method signature changes accidentally released in 3.3.1
3.3.1
  • Support codeception/lib-innerbrowser v4
3.3.0
  • Improved handling of boolean and null values in xpath methods (#88) by @pamoller
3.2.0
  • Add (dont)seeResponseJsonXpathEvaluatesTo methods #85
  • Fixed return type of grabHttpHeader method #86
2.0.2
  • Don't pass NULL to isBinaryData in _failed.
3.1.0
  • Moved JSON constraints from codeception/codeception to module-rest
  • XML related code shared with SOAP module was moved to codeception/lib-xml
3.0.1
  • Don't pass NULL to isBinaryData in _failed.
3.0.0
  • Codeception 5 support
  • Update to min php8 (#70) by @pbojan
2.0.1
1.4.2

Added seeResponseIsJson() to send*AsJson actions

1.4.1

Step descorator AsJson was introduced to simplify sending and parsing JSON requests and responses. Add it to suite configuration:

actor: ApiTester
step_decorators:
    - \Codeception\Step\AsJson

or if you use API template:

suites:
    api:
        actor: ApiTester
        step_decorators:
            - \Codeception\Step\AsJson

Rebuild actions:

./vendor/bin/codecept build

And you get new actions:

  • sendPostAsJson
  • sendGetAsJson

... basically all send* methods will receive AsJson pair which sends request in JSON and returns parsed response:

<?php
$user = $I->sendPostAsJson('user', ['id' => 1]);
codecept_debug($user['id'])
$I->assertEquals(1, $user['id'])
1.4.0

send* actions were updated to return a response:

$response = $I->sendGet('/users');
$response = $I->sendPost('/users', ['name' => 'jon']);
$response = $I->sendPut('/users/1', ['name' => 'jon']);
$response = $I->sendPatch('/users/1', ['name' => 'jon']);
$response = $I->sendDelete('/users/1');
$response = $I->send('PATCH','/users/1', ['name' => 'jon']);
1.3.2
  • Preserve zero fraction when encoding json #63 by @RusiPapazov
1.3.1

Revert change implemented in 1.3.0

1.3.0
  • Add generic send method taking HTTP method as parameter
  • Don't send request body with DELETE and OPTIONS requests
  • Validate url and params parameters of all send methods
  • Document that sendPost, sendPut, sendPatch methods accept string and JsonSerializable as params too
  • Other documentation improvements
1.2.8

Append query params to URL for HEAD requests

1.2.7
  • Replaced deprecated JsonPath data() method with getData #37 by @SoftCreatR
1.2.6
  • Replace flow/jsonpath with softcreatr/jsonpath (#35)
1.2.5
1.2.4
1.2.3
1.2.2
  • Support for negative values, >= and <= matchers in JsonType comparisons .
  • Improved docs for Json Matchers
1.2.1
1.2.0
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport