GuidesAPI Reference
API Reference

getCapturedRequest(requestId)

Returns a captured request by Id

import Mimic from 'mimic';

Mimic.getCapturedRequest('request-id');

Output

{
  "id": "609bdfcd-eb83-4d57-8e84-8823258fcd9a",
  "method": "GET",
  "url": "http://jsonplaceholder.typicode.com/posts/1",
  "headers": {
    "accept": "*/*"
  },
  "origin": "http://localhost:8080",
  "startTime": 1495787559607,
  "response": {
    "status": 200,
    "delay": 754,
    "headers": {
      "pragma": "no-cache",
      "content-type": "application/json; charset=utf-8",
      "cache-control": "public, max-age=14400",
      "expires": "Fri, 26 May 2017 12:32:40 GMT"
    },
    "body": "{\n  \"userId\": 1,\n  \"id\": 1,\n  \"title\": \"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\",\n  \"body\": \"quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto\"\n}"
  }
}