Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot access previous response in repository with DHC

Tags:

dhc

I use DHC by Reslet a Chrome extension, version 1.2.

When I create a first POST request to create an entity If I want to access to this request in a another request (repository feature) I cannot access the response.

I have the same problem with DELETE requests, but not for GET requests

like image 713
Sbert Avatar asked Oct 18 '22 16:10

Sbert


1 Answers

I'm not sure to correctly understand what you want to do but I'll try to give you an answer.

Imagine I want to execute the following:

  • POST request to add a company using the URL /companies and get its identifier from the response
  • GET request to get the newly created company using the identifier from the previous request

To do that I need to save the first request. I save it with the name 1 - Add company under the project Company project and the service CRUD service:

Company project
  CRUD service
    1 - Add company

Here is what I can use within the second request within its URL field:

contactsapi.apispark.net/v1/companies/{"Company project"
    ."CRUD scenario"."1 - Add company".response.body.id}

This way DHC will use the value of the id field in the response body from the latest executed 1 - Add company request in the history.

like image 195
Thierry Templier Avatar answered Nov 28 '22 07:11

Thierry Templier