Probem with JSON/RAW Parameters - HTTP Request


i have now tried it with 2 different API Endpoints ( VMware vCloud Director and Odin Plesk ), but I always fail at the raw headers.

ERROR: Cannot create property ‘accept’ on string ‘{“accept”: “text/xml”,“HTTP_AUTH_LOGIN”: “admin”,“HTTP_AUTH_PASSWD”: “xxx”,“HTTP_PRETTY_PRINT”: “true”,“Content-Type”: “text/xml”}’

ERROR: Cannot create property ‘Content-Type’ on string ‘{ ‘Accept’: ‘application/*+json;version=35.0’, ‘Content-Type’: ‘application/vnd.vmware.admin.organization+xml;charset=ISO-8859-1’, ‘x-vcloud-authorization’:’’ }’

Plesk RPC API:

Cloud Director:

Information on your n8n setup

  • n8n version: 0.172.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]: own
  • Running n8n via [Docker, npm,, desktop app]: npm + pm2

Hey @ChristianV,

Welcome to the community :rocket:

What happens if you remove the content type?

Hey @ChristianV, I just gave this a go on my end and it seems n8n doesn’t like a string in the headers field for your first example. Looks like a small bug to me and I’ll take a closer look into this when I have a bit more time.

As a quick workaround I was however able to just return a JSON object through an expression like so:

Could you give this a go on your end and see if this does the trick for you as well?

Hey @ChristianV, just a quick update on this one: I was able to reproduce the problem and it seems n8n fails to convert the string from your header field into a JSON object when RAW/Custom is selected in the Body Content Type field.

As a workaround you can either remove this setting as suggested by @Jon above (when sending JSON data), or alternatively use an expression to return a JSON object in the headers field instead of a string as suggested in my workaround above (this will also work for your XML data).

I have added this to our internal bug tracker and we’ll of course confirm once this has been fixed.

@MutedJam @Jon , thanks for your replys.

@MutedJam The workaround with the expression works, but if i would like to add a real expression, as in the clouddirector, here i have to add, the “x-vcloud-authorization” from the login session response!?

@Jon To remove the content type, doesnt work, cause this api endpoint require it to work with it.

Hey @ChristianV, you can of course adjust my example to add more headers. I think the expression you’re looking for would be {{ { "accept": "text/xml", "HTTP_AUTH_LOGIN": "admin", "HTTP_AUTH_PASSWD": "xxx", "HTTP_PRETTY_PRINT": "true", "Content-Type": "text/xml", "x-vcloud-authorization" :$json["headers"]["x-vcloud-authorization"] } }} in this case.