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

Unit test of POST request uses body format #12

Closed
netsensei opened this issue Dec 14, 2016 · 1 comment
Closed

Unit test of POST request uses body format #12

netsensei opened this issue Dec 14, 2016 · 1 comment

Comments

@netsensei
Copy link
Contributor

The POST request test uses the old JSON body format to push a record to the Datahub. Like this:

list($crawler, $response, $data) = $this->apiRequest('POST', '/v1/data', [
    'format' => $dataConverterId,
    'data'   => $testData,
]);

Later on, we decided to abandon this approach and go for a new way of POST'ing data to the API:

  • The body would contain the entire un-encapsulated record. Serialised in a target format (LIDO, MARC,...)
  • The type of data is defined in an HTTP request header.
  • The datahub configuration has a parameter which data is accepted.

TODO

  • The unit test for the POST reuqest should be adapted to reflect the new changes
  • The apiRequest() method in OAuthTestCase currently only allows for posting JSON data and needs to be expanded / adapted.
@netsensei
Copy link
Contributor Author

This issue was fixed in development sprint May / June 2017. Closing.

The HTTP request now expects a valid XML document as raw body and a Content-Type: application/lido+xml HTTP request header.

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

1 participant