Requestly not modifying api's response

I am having an oddity – I set up Requestly to intercept an API, but when that API is called, Requestly is intercepting it (or at least seeing that it came through) BUT Requestly isn’t returning what I want it to return, instead it is still returning the results from the actual API call. Does that make sense? I have poked and tried different things, but I really can’t find what is causing this.

I suspect it may have something to do with how things are configured, but for the life of me I can not figure it pit. Can anyone give me a pointer or an avenue to investigate further? I am using Chrome.

Hi @catdragon. There was a bug in Requestly which looks similar to your situation. Some fixes were made recently to fix it.
Can you please open URL chrome://extensions in the Chrome browser and click “Update” if the extension’s version is less than 22.8.27?
If you still see the issue, please share the rule so I can investigate.

I am using 22.8.27… let see if i can figure out how to attach the rule.

[
  {
    "createdBy": null,
    "creationDate": 1661528751994,
    "currentOwner": "kFn5IMeaLUTKsP7rvBUa6b3o4Mq2",
    "description": "to return a specific error when called",
    "groupId": "",
    "id": "Response_7js3y",
    "isSample": false,
    "lastModified": 1661805972409,
    "lastModifiedBy": null,
    "modificationDate": 1661805972409,
    "name": "tax api",
    "objectType": "rule",
    "pairs": [
      {
        "id": "673zo",
        "response": {
          "statusCode": "",
          "type": "static",
          "value": "{\n  \"msg\": \"success\",\n  \"status\": 200,\n  \"timecost\": 665,\n  \"params\": {\n    \"params\": \"Parameters are too large, skiped in return\"\n  },\n  \"logKey\": \"64ff3c9a58bb4fcca7acae35c9f64231\",\n  \"data\": {\n    \"resultCode\": 2990,\n    \"resultDesc\": \"ESB tax error: 2950-User generated exception+++RFC Response Error: 05 : Required field TAX_HEADER_IN-SH_STATE has no input.+++TaxCalcService.Process RFC Response\",\n    \"header\": {\n      \"currency\": \"USD\",\n      \"taxAmt\": 0,\n      \"canadaGST\": 0,\n      \"canadaPST\": 0,\n      \"canadaQST\": 0,\n      \"canadaHST\": 0,\n      \"errorFlag\": true\n    },\n    \"lineItems\": [\n      {\n        \"itemNum\": 1,\n        \"partNum\": \"D09PVLL\",\n        \"taxAmt\": 0\n      },\n      {\n        \"itemNum\": 2,\n        \"partNum\": \"E0794LL\",\n        \"taxAmt\": 0\n      },\n      {\n        \"itemNum\": 3,\n        \"partNum\": \"E0794LL\",\n        \"taxAmt\": 0\n      },\n      {\n        \"itemNum\": 4,\n        \"partNum\": \"E0794LL\",\n        \"taxAmt\": 0\n      }\n    ]\n  }\n}"
        },
        "source": {
          "filters": [],
          "key": "Url",
          "operator": "Contains",
          "value": "/dsw/eorder/blueapi/v1/tax"
        }
      }
    ],
    "ruleType": "Response",
    "status": "Active"
  }
]

Thanks! @catdragon for sharing this. Could you please tell us where we can test this?

PS: Not related. we have a much better mechanism to share the rules with other folks.

Try this next time

  • Select the rule
  • Click on Share Button, and you get a link
  • Share the link with anyone

Other persons can simply get the rule on their machine by clicking import Rules :slight_smile: Here’s a demo video - Share rules and collaborate with team mates! - YouTube

I’m within the Firewall at IBM, so i really don’t have a place for you to test it. I know isn’t any help and i am sorry about that.

Hi @catdragon. Sorry to hear that it didn’t work for you.
Can you please share more insights like:

  • Which API method does the original code use - XMLHttpRequest or fetch?
  • What is the Content-Type response header of original API?
  • Do you know if code expects it to be a blob instead of JSON? Requestly does not support blob responses yet.

Please note that in browser inspect Network panel, you would still see the original response. But in code, it should ideally receive the modified content.