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 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.