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

INVALID_CONTENT error in raw request with patch HTTP method #5

Open
navidadelpour opened this issue Mar 4, 2024 · 3 comments
Open

Comments

@navidadelpour
Copy link

The raw request as demonstrated below:
image
Is not working and gives:

[
  {
    "type": "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1",
    "title": "Bad Request",
    "status": 400,
    "o:errorDetails": [
      {
        "detail": "Invalid content in the request body.",
        "o:errorCode": "INVALID_CONTENT"
      }
    ]
  }
]

But in the postman it is working properly (gives 204 code)
image

@navidadelpour
Copy link
Author

Hi @drudge @ubtashton
Am I making a mistake? I've checked the source code and in NetSuite.node.ts#L305 it sets query = body. does it creates the problem?

@navidadelpour
Copy link
Author

Ok, I've figured it out.
I used a Set node before the NetSuite Node and removed the body parameter like this:
image

And query would use item.json instead of the body field (const query = body || (item ? item.json : undefined);).

I guess that the root of the problem is that the body is string (const body = fns.getNodeParameter('body', itemIndex) as string;) but the query expects to receive an object.

Should I fix this in a PR? @drudge

@drudge
Copy link
Owner

drudge commented Dec 14, 2024

Yes please

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

No branches or pull requests

2 participants