Nyaruko
Nyaruko

Reputation: 4459

How to set raw header using winHttp for user name?

I used to access my own small server using Qt, and I could set my raw header using Qt like this:

        QString concatenated = "admin:admin";
        newRequest.setRawHeader("Authorization", concatenated.toLocal8Bit());

But how could I do the same thing using winHttp? How could I add the username password as admin:admin in my winHttp header?

Upvotes: 0

Views: 235

Answers (1)

Michael Palermo
Michael Palermo

Reputation: 306

Use the SetRequestHeader method as defined here https://msdn.microsoft.com/en-us/library/windows/desktop/aa384060(v=vs.85).aspx

Upvotes: 1

Related Questions