# Issues when using pm.sendrequest in Native GIT

**URL:** <https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334>\
**Category:** Help Hub\
**Tags:** tests, collections, postman, git\
**Created:** [March 13, 2026, 11:43am UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334 "2026-03-13T11:43:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maintenance-technol7](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@maintenance-technol7](https://community.postman.com/u/maintenance-technol7)\
**Post date:** [March 13, 2026, 11:43am UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334/1 "2026-03-13T11:43:44Z")

</div>

Hello everyone.

I’m trying to migrate some Postman Collection to Postman v12 for my team but I have an issue when I execute pm.sendRequest from Before Request script in Collection.

I did a small tests using a Test Collection and the Request works as expected when using Postman Cloud however the same Request fails when running from Native GIT in Postman.

Can someone please confirm if this is expected or maybe a known issue?

I’m using Postman v12.1.4

Thank you.

**Example Collection**

Postman collection including a GET request to [https://api.restful-api.dev/objects](https://api.restful-api.dev/objects)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/b/0/b0886474ed082a3c5660b3839748999a886a007e.png)

Before Request Script

```javascript
pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});

```

**Results in Postman Cloud**

Works with no issues.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/a/1ad7be8119bb0a64c15996198dfdee980411462b.png)

**Results using Native GIT**  
Request hangs up and never finishes. Leading to Postman crash.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/e/1/e1c0a0333dbd716a47deffd698191c151a607141.png)

---

<div class="post-metadata">

**Author:** ![appurva21](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/appurva21/32/34560_2.png) [@appurva21](https://community.postman.com/u/appurva21)\
**Post date:** [March 13, 2026, 12:09pm UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334/2 "2026-03-13T12:09:00Z")

</div>

Hey @maintenance-technol7! Thanks for the report. I can notice some inconsistencies in the mentioned workflow. We’ll look into this and provide an update here once the fix is out.

---

<div class="post-metadata">

**Author:** ![guyarad](https://avatars.discourse-cdn.com/v4/letter/g/d26b3c/32.png) [@guyarad](https://community.postman.com/u/guyarad)\
**Post date:** [March 16, 2026, 12:37am UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334/3 "2026-03-16T00:37:20Z")

</div>

It looks like the same issue I’m experiencing. Posted in Discord:

I tried using the Git-backed workspace. In the pre-request script I’m using `pm.sendRequest` to send a request to an unrelated API. The engine is not calling the additional API, but instead is triggering the pre-request script again - resulting in an infinite loop (I have console.log in my script) and Postman getting stuck.

Adding this in the pre-request script fixes the issue:

```typescript
if (pm.request.url.toString() == externalAPI) {
    console.log("Login request — skipping pre-request auth:", pm.request.url.toString());
    return;

```

This behavior is different for a regular workspace, not Git-backed. Same exact script. Works without the additional condition.

---

<div class="post-metadata">

**Author:** ![maintenance-technol7](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@maintenance-technol7](https://community.postman.com/u/maintenance-technol7)\
**Post date:** [March 16, 2026, 9:08am UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334/4 "2026-03-16T09:08:46Z")

</div>

Thanks @guyarad for the workaround! I was experiencing the exact same issue — `pm.sendRequest` in a collection-level pre-request script was causing an infinite loop and crashing Postman in my Git-backed workspace. Adding the URL guard to short-circuit the pre-request script when the request matches the external API resolved it.

Hopefully the Postman team addresses this soon so `pm.sendRequest` behaves consistently between Git-backed and regular workspaces without needing a workaround.

**Updated Before Request:**

```javascript
const externalAPI = 'https://postman-echo.com/get';

if (pm.request.url.toString() == externalAPI) {
    console.log("External request — skipping pre-request auth:", pm.request.url.toString());
    return;
}

pm.test("Status code is 200", function () {
    pm.sendRequest(externalAPI, function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});

```

---

<div class="post-metadata">

**Author:** ![appurva21](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/appurva21/32/34560_2.png) [@appurva21](https://community.postman.com/u/appurva21)\
**Post date:** [March 16, 2026, 9:43am UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334/5 "2026-03-16T09:43:19Z")

</div>

@maintenance-technol7 @guyarad This issue is now resolved in the latest version of the Postman app (v12.2.0). Please update your app to receive the fix. Let us know if you encounter any further issues.

---

<div class="post-metadata">

**Author:** ![satellite-geologist1](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@satellite-geologist1](https://community.postman.com/u/satellite-geologist1)\
**Post date:** [March 21, 2026, 8:02am UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334/7 "2026-03-21T08:02:19Z")

</div>

I have 12.2.0 on Mac and am still having this problem, but now Ive updated to the 12.2.3 … maybe its fixed here (?)

---

<div class="post-metadata">

**Author:** ![devesh-kumar-postman](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/devesh-kumar-postman/32/34127_2.png) [@devesh-kumar-postman](https://community.postman.com/u/devesh-kumar-postman)\
**Post date:** [March 21, 2026, 2:41pm UTC](https://community.postman.com/t/issues-when-using-pm-sendrequest-in-native-git/89334/8 "2026-03-21T14:41:35Z")

</div>

Hi @satellite-geologist1 I just tried the described issue step-by-step and was not able to reproduce it.

Since you mentioned you’ve updated Postman to 12.2.3, could you confirm if this is still a problem for you?
