Solved

Passing multiple custom headers in a REST API RSD file

  • 10 March 2023
  • 3 replies
  • 148 views

Badge +1

Hi all,

I need to pass multiple custom headers in a RSD file:

  • Host: xxxxx.cloud.xxxxx.com
  • Authorization: Bearer dfdflejlflefdjeljfeoj
  • Content-Length: 26

Is this the correct way to do this?

	<api:set attr="Header:Name#1" value="Authorization" />
<api:set attr="Header:Value#1" value="Bearer dfdflejlflefdjeljfeoj" />

<api:set attr="Header:Name#2" value="Host" />
<api:set attr="Header:Value#2" value="xxxxx.cloud.xxxxx.com" />

<api:set attr="Header:Name#3" value="Content-Length" />
<api:set attr="Header:Value#3" value="26" />

Greets, Rogier

icon

Best answer by Thomas Lind 10 March 2023, 10:39

View original

3 replies

Userlevel 5
Badge +5

Hi Rogier

Yes.

I am not sure if you need to number them, but that is likely something you need to do to not overwrite the values.

Also I have found that the naming is a little bit different.

For example Content-Type will need to be specified as ContentType when you apply it in the RSD file.

So the Content-Length one probably needs to be changed to just ContentLength.

Be sure to set up a log and check if it shows the values there when you run the file.

Badge

Hi @Thomas Lind 

In the old version, we were able to add multiple rows in the custom headers by using the "enter" key. It seems that this is not possible in the new version. If I want to add multiple lines, how can I do that? I dont need RSD file. 

Userlevel 5
Badge +5

Hi Erdem

It is still possible in the new one, you just have to do it a bit differently.

Essentially you add this \r\n between each header you want to add.

Reply