0

I'm trying to use a script task to set the username/password of a httpConnection connection, but I can't figure out how to do this.

Current attempt:

httpClient.Properties["ServerUserName"].SetValue(httpClient.Properties["ServerUserName"], "someJunk");

This results in an InvalidCastException (Even though said property is a string).

What am I doing wrong here?

Tsaukpaetra
  • 579
  • 5
  • 26

1 Answers1

0

This is an example of lack of documentation maybe? The SetValue function is expecting an object, which should be the same object it's being called on.

I.e.:

httpClient.Properties["ServerUserName"].SetValue(httpClient, "someJunk");

Thanks, Reflection!

Tsaukpaetra
  • 579
  • 5
  • 26