Solved

httpclient activity not passing header value

  • 21 September 2023
  • 7 replies
  • 126 views

Userlevel 5
Badge +16

Here is the form activity.

 

 

Now here is the logs…

SetActivityInputs: starting activity with inputs [<inputs><request><method>POST</method><postType>Form</postType><postContent /><postContentType>application/json; charset=UTF-8</postContentType><headers><name>Accept</name><value>application/json</value></headers><headers><name>Authorization</name><value /></headers></request></inputs>]

As you can see the value for authorization is empty.

 

The variable is set, but no matter what I do it refuses to honor it.

icon

Best answer by Navneet Singh 21 September 2023, 08:41

View original

7 replies

Userlevel 3
Badge +10

@christopherlecky 

If you are using a POST operation then Content-Type Header should get used.

If doesn’t work then please follow the below DOCs and try.

https://documentation.commvault.com/2023e/essential/131558_adding_input_to_workflow.html

https://documentation.commvault.com/2023e/expert/49530_creating_sample_workflow.html

https://api.commvault.com/

Userlevel 5
Badge +16

I tried content-type earlier, I switched to form out of desperation.If you look at the logs you can even seen that content-type is being sent.

 

Userlevel 4
Badge +10

Hi @christopherlecky ,

Just tried this in my lab. I wonder if your variable vCenterAuthString is not getting populated. If I run it I am getting the value populated.

 

SetActivityInputs: starting activity with inputs [<inputs><request><url>https://vcenter.lab.local/api/session</url><method>POST</method><postType>Raw</postType><postContent /><postContentType>application/json; charset=UTF-8</postContentType><headers><name>Authorization</name><value>Basic EncryptedUsernamAndPassword</value></headers><headers><name>Accept</name><value>application/json</value></headers></request></inputs>]

 

Userlevel 5
Badge +16

Hi @christopherlecky ,

Just tried this in my lab. I wonder if your variable vCenterAuthString is not getting populated. If I run it I am getting the value populated.

 

SetActivityInputs: starting activity with inputs [<inputs><request><url>https://vcenter.lab.local/api/session</url><method>POST</method><postType>Raw</postType><postContent /><postContentType>application/json; charset=UTF-8</postContentType><headers><name>Authorization</name><value>Basic EncryptedUsernamAndPassword</value></headers><headers><name>Accept</name><value>application/json</value></headers></request></inputs>]

 

It is, when I run debug I can see the value.

Userlevel 5
Badge +16

it was a typo

Userlevel 4
Badge +10

Glad you cracked it!

Userlevel 5
Badge +16

@Graham Swift thanks.

Reply