C ++ web access authentication?

I am trying to write a simple GUI application using the Qt framework.

The purpose of this application is to extract data from my isp and parse it for presentation.

How do I authenticate my user / password to the web server and get the html page?

Are there any lib utilities that make this task trivial?

I suppose I need to interact with the server php script and simulate form input in some way.

Am I on the right track?

0


a source to share


2 answers


The authentication method depends entirely on the authentication method used by the server. If you need some kind of login form, you need to get that and submit the correct data to the action

target form (usually as a POST

request). You can do this by building your request using a QHttpRequestHeader and then simply sending it to the server. If you even know about the form, you might not even need to get the login page. If the website uses HTTP authentication, you can use QAuthenticator .



0


a source


You are on the right track, I suggest taking a look at curl . This should make it much easier.



+1


a source







All Articles