Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported payload message when JSON object body is empty {} #427

Open
pawsad opened this issue Oct 22, 2021 · 4 comments
Open

Unsupported payload message when JSON object body is empty {} #427

pawsad opened this issue Oct 22, 2021 · 4 comments

Comments

@pawsad
Copy link

pawsad commented Oct 22, 2021

  • Application version: 16.0.1
  • Operating System (Platform and Version): Windows 10 20H2

Expected Behavior
The application send my request without any error message.

Actual behavior
The application is not sending my request, the error message is:

The requested URL can't be reached
The service might be temporarily down or it may have moved permanently to a new web address.
Unsupported payload message

The message is confusing, suggests the service is unavailable or does not support the format, but the application is not trying to send the request. It works fine in addition to chrome "Advanced REST client" and in the Postman, for example.

To Reproduce
Set the POST body to an empty JSON object and try sending the request:

{}

@jarrodek
Copy link
Member

Hi,
Sorry for the late response.
Does this issue still persist? I believe there is an error while running the request which is not reported in the UI. Do you see any error messages in the developer console?

@pawsad
Copy link
Author

pawsad commented Dec 23, 2021

Hi,
Yes, it does. I do not see newer version of ARC. Application do not try to send it.
Did you try to reproduce the issue? It is pretty easy to reproduce and analyze on your own (unless the problem only occurs with me?).

It works for any other body:

  • { "foo" : "bar" }
  • {foo}
  • []
  • { : }
  • {
  • }

But do not work for empty object like:

  • { }

In the console I see only first log:
The config passed to the request factory: {...}

The is no Processing status and any other logs/errors.

@pawsad
Copy link
Author

pawsad commented Dec 23, 2021

I followed the advice of looking at developer tools and I searched deeper. I'm not familiar with Electron, but I found that if the payload is JS object instead of string then the payloadToBuffer(payload, headers) method is trying to manage some special case and if this is not ArrayBuffer, Buffer, FormData, or Blob instance then there is the Error ('Unsupported payload message') thrown.

There is more cases when the issue occurs (any JS object), example:

  • {foo:123}
  • {foo:"bar"}

@jarrodek
Copy link
Member

jarrodek commented Feb 1, 2022

I can reproduce this. The variables processor treats this input as a variable without any name. As a result, it produces an empty object which in ARC it is an invalid payload. I will try to address this in v18 which has a new variables processor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants