FormData is blank

Hi Guys, I’m currently having a trouble with sending form data using post method.

here is my code.

const { entrypoints } = require("uxp");
const { app } = require("indesign");

entrypoints.setup({
  commands: {
    showAlert: () => showAlert()
  },
  panels: {
    showPanel: {
      show({ node } = {}) { }
    }
  }
});

showAlert = () => {
  const dialog = app.dialogs.add();
  const col = dialog.dialogColumns.add();
  const colText = col.staticTexts.add();
  colText.staticLabel = "Congratulations! You just executed your first command.";

  dialog.canCancel = false;
  dialog.show();
  dialog.destroy();
  return;
}

login = async () => {
  let url = "http://localhost:5000/Login"

  let data = new FormData()

  data.append('userId', '12321')
  
  await fetch(url, {
    method: "POST",
    body:data
  })
}

here is my manifest file

{
    "id": "com.adobe.uxp.indesign.quick.starter",
    "name": "Quick Starter",
    "version": "1.0.0",
    "main": "index.html",
    "host": {
        "app": "ID",
        "minVersion": "18.5.0"
    },
    "requiredPermissions": {
    "network": {
      "domains": "all"
    }
  },
    "manifestVersion": 5,
    "entrypoints": [
        {
            "type": "command",
            "id": "showAlert",
            "label": "Show alert"
        },
        {
            "type": "panel",
            "id": "showPanel",
            "minimumSize": {"width": 230, "height": 200},
            "maximumSize": {"width": 2000, "height": 2000},
            "preferredDockedSize": {"width": 300, "height": 300},
            "preferredFloatingSize": {"width": 300, "height": 300},
            "label": {"default": "Show panel"},
            "icons": [
                {
                    "width": 23,
                    "height": 23,
                    "path": "icons/dark.png",
                    "scale": [
                        1,
                        2
                    ],
                    "theme": [
                        "darkest",
                        "dark",
                        "medium"
                    ]
                },
                {
                    "width": 23,
                    "height": 23,
                    "path": "icons/light.png",
                    "scale": [
                        1,
                        2
                    ],
                    "theme": [
                        "lightest",
                        "light"
                    ]
                }
            ]
        }
    ],
    "icons": [
        {
            "width": 48,
            "height": 48,
            "path": "icons/plugin.png",
            "scale": [
                1,
                2
            ],
            "theme": [
                "darkest",
                "dark",
                "medium",
                "lightest",
                "light",
                "all"
            ],
            "species": [
                "pluginList"
            ]
        }
    ]
}

when I try to hit the endpoint in shows a blank payload.

Please help, I’m stuck with it for the past few hours…

Can you confirm that your server running at http://localhost:5000/ is also not receiving the form data?

I ran just your login function in the UXP debug console against my local server. I was able to see the request body being received correctly on the server, even though it didn’t show up in the Network tab of the UXP debug console.

@salinsley yes my localhost is running. I’m using C# .net as my backend and somehow it’s not getting the forndata from the request