In my previous battle against Internet Explorer add-on (BHO), I discovered some valuable (and scarce) resources to my aid. Pete‘s TinyBHO and CPeteHttpRequest probably saved the most of my day.
Then I realized a problem: for the browser add-on that I was writing, I would have to fetch a Web page from a server that requires user login. Under typical usage scenarios, the users are assumed to have logged in the server in a previous session, so the Web server will authorize the user from cookies. However, using WinHttp
on which CPeteHttpRequest
is based on, there seems to be no (simple) ways to obtain the user’s cookies and embed it in the HTTP request. I couldn’t find another piece that is as simplistic as CPeteHttpRequest
and also able to deal with my problem at hand.
So I wrote one myself.
K2HttpRequest
has the usage of:
K2HttpRequest request;
// Synchronous wstring innerHTML = request.request ( L"http://www.google.com" );
// Asynchronous
void foo ( wstring innerHTML ){}
request.SetOnComplete ( foo );
request.request ( L"http://www.google.com", true );
K2HttpRequest
uses IWebBrowser2
internally, which means it opens a new Internet Explorer instance under the hood and loads the Web page with it. Thus, the server will receive login cookies as if the user visited the Web page. It will fetch the Web page at the specified URL and return the HTML in the <body>
element (I actually intended return the whole <html>
element but I can’t find an easy way to do it, as IHTMLDocument2
doesn’t have get_innerHTML()
)
This is still a very preliminary version, and will probably improve as my COM/ATL skills improve some day.
Download K2HttpRequest(source code ~5KB, Visual C++ 2008)
(Update: The asynchronous part of this doesn’t work very well. I didn’t know COM enough to use Marshalling when I wrote this version. I’ll probably update this some day. If you want to get the asynchrounous part working, you’ll probably have to add in marshalling yourself :p)
strongest over the counter painkillers over the counter blood pressure medicine
strongest over the counter diuretic over the counter urinary tract infection meds
tamiflu over the counter is ivermectin over the counter
best over the counter dark spot remover over the counter asthma inhaler
over the counter antihistamine over the counter viagra
https://stromectol.science/# price of stromectol
https://zithromax.science/# azithromycin zithromax
Generic Name. safe and effective drugs are available. buy liquid ivermectin All trends of medicament. Medicament prescribing information.
п»їMedicament prescribing information. Get here. cost of ivermectin Read information now. safe and effective drugs are available.
Commonly Used Drugs Charts. п»їMedicament prescribing information. https://stromectolst.com/# purchase ivermectin Commonly Used Drugs Charts. Everything what you want to know about pills.
Comprehensive side effect and adverse reaction information. Some trends of drugs. ivermectin australia Everything what you want to know about pills. Get here.
Get here. Prescription Drug Information, Interactions & Side. https://stromectolst.com/# stromectol tab price Get here. Definitive journal of drugs and therapeutics.
safe and effective drugs are available. Cautions. https://stromectolst.com/# ivermectin 3mg earch our drug database. drug information and news for professionals and consumers.
Drugs information sheet. Definitive journal of drugs and therapeutics. ivermectin 6mg Some trends of drugs. Read information now.
Get information now. safe and effective drugs are available. https://stromectolst.com/# ivermectin 3mg tablets Drug information. What side effects can this medication cause?
Read here. Generic Name. ivermectin cream 1% safe and effective drugs are available. п»їMedicament prescribing information.
earch our drug database. Commonly Used Drugs Charts. ivermectin 2mg Learn about the side effects, dosages, and interactions. Some trends of drugs.
Some trends of drugs. Definitive journal of drugs and therapeutics. cost of stromectol medication Read information now. Top 100 Searched Drugs.
Generic Name. Everything about medicine. ivermectin usa drug information and news for professionals and consumers. Actual trends of drug.