Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am looking for the very simplie way to fetch HTML body of a remote web site into a string using default C++ libraries or WinAPI.
There are no default C++ libraries to do this. And I'm not familiar with WinAPI. But check out the libcurl website here: http://curl.haxx.se/libcurl/. That site has a listing of "competitor" libraries that may be of use.
Have a look at Microsoft's WinInet API:
The Microsoft Windows Internet (WinINet) application programming interface (API) enables applications to access standard Internet protocols, such as FTP and HTTP. For ease of use, WinINet abstracts these protocols into a high-level interface.
Or Microsoft's WinHTTP API:
Microsoft Windows HTTP Services (WinHTTP) provides developers with an HTTP client application programming interface (API) to send requests through the HTTP protocol to other HTTP servers.
They are both built into Windows. You simply need to link to either wininet.dll or winhttp.dll, then #include either wininet.h or winhttp.h in your code, and call the relevant HTTP functions as needed.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 11 months ago.
Improve this question
I am trying to implement document signing with the DocuSign API in our Windows desktop application built in VC++.
Our application is built with unmanaged code without using .net. I tried the supported languages, C++ is not available so I tried C# that is web interface which I can't use inside my application.
How can I use the DocuSign API in an unmanaged c++ application?
You can use the Microsoft open-source REST API C++ SDK
https://github.com/microsoft/cpprestsdk
"
C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services."
You will still need to get an integration key and set it up for authentication, maybe use JWT since it's a desktop app.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a question about https and qt network.
I would like to know if I use https url, can I use the same code like http url or I must do some changes. Does someone can say which change I must do?
ps: I would like to auth to my https website and do get/post
HTTPS will work with Qt so long as OpenSSL is available.
On Mac and Linux, this is typically an automatic. On Windows, you will likely need to build and ship the OpenSSL 1.0.x binaries, libeay32.dll and ssleay32.dll, with your application. If Qt can dynamically load these binaries at startup, HTTPS support will be available. Or rebuild Qt from source to statically link with the OpenSSL libraries.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have written a service using C++ and Qt framework (QtService). The service should run in the background. I need the service to have a web user interface and can be accessed using web browsers. I mean the service should act as as a web server and output html content to a specific port. I know there are some frameworks that can be used to generate web content in C++, but by taking into account that I am using Qt, I prefer to use Qt features as much as possible rather than a new framework. Any ideas?
I have read about Cutelyst on the Qt blog a few times, which seems an exact fit to your question.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm developing an application that communicates with an internal web service using HTTP.
Are there any "best practices" for custom user-agent strings so that I can put a nice one in my app? It's a Python library and the lower transport is Python's own httplib. Should the user-agent string say that or something else?
For internal use you can use anything really.
Of course, internal or external its always a good idea to include contact information, either web or email address, in case something breaks or application goes out of control.
Check this big list of user agents for inspiration: http://www.user-agents.org/
It is considered good practice to include at least an email address so people can contact you if your application is causing problems. This will also be your best chance of not getting blocked.
It's common to put a name and version number as well. Other than that it's mostly freestyle. user-agents.org has alot of examples.
Don't forget to honor robots.txt as well.
You can write in user-agent what you want! But if you beware of your application HTTP queries to this server may be blocked, set user-agent to common browser (like Firefox on Gecko engine) then server admin don't know what application reads her page and in server logs don't see your application.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Do you recommend any good library or examples online for implementing an HTTPS client that can connect to a website using basic authentication? This is meant to run in linux servers.
Any pointers help.
Update: Question about the unanimous libcurl - does it come bundled by default in major distributions like Debian, Ubuntu, Gentoo, Slackware, RedHat and Arch?
libcurl supports both HTTPS and HTTP Basic Authentication. There's plenty of example code online.
All of the distributions you mention have libcurl packaged. It is not absolutely certain to be installed, but it is very common.
libcurl
A free and easy-to-use client-side URL transfer library, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, FILE, LDAP and LDAPS. libcurl supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunneling and more.
I have used libcurl and can recommend it.