Alter querystring through APP



While using Igor's Passthru APP I need to add a querystring to a
requested url.
In my Start() method I am appending the querystring to szUrl
parameter and calling target app's Start() method with the new URL
with querystring. The request gets sent with the new url.

STDMETHODIMP CTestAPP::Start(
LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink,
IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)

{
LPCWSTR szUrlQuery = szUrl + querystring //add querystring to url
targetApp -> Start(szUrlQuery, ...) //call target app's start with new
url
}

In my ReportData() method my App calls targetSink's ReportProgress
method with BINDSTATUS_REDIRECTING flag with the new URL (szUrlQuery)
to notify the request URL had been changed.

STDMETHODIMP CTestSink::ReportData(
/* [in] */ DWORD grfBSCF,
/* [in] */ ULONG ulProgress,
/* [in] */ ULONG ulProgressMax)
{

m_spInternetProtocolSink->ReportProgress(BINDSTATUS_REDIRECTING,
szUrlQuery); //notify redirect with new URL with querystring

m_spInternetProtocolSink->ReportData((BSCF_FIRSTDATANOTIFICATION |
BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE), dwLegth,
dwLegth); //notify target sink of data

hr = m_spInternetProtocolSink->ReportResult(S_OK, S_OK, NULL);

}
I tested by typing URL without querystring in the address bar and saw
how APP added the querystring and sent correct request. I receive
the correct form and the browser address bar displays the new URL with
the querystring.
However, when I submit the form, that is suppose to request the same
URL+ querystring, the browser sends to APP a request without the
querystring. Why does this happen?
If I ignore this problem and have my APP add the querystring to the
URL on the second request, then the page will appear in browser in
exactly the same way as before. However when I submit the form again
(3-request) , the browser doesn't send the request (and app doesn't
start) and gives "The webpage cannot be displayed" message. Also the
browser address bar shows some gibberish. Does anybody know what I am
doing wrong?

.



Relevant Pages

  • Re: Alter querystring through APP
    ... In my Startmethod I am appending the querystring to szUrl ... The request gets sent with the new url. ... right before calling Start on target APP. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Alter querystring through APP
    ... In my Startmethod I am appending the querystring to szUrl ... The request gets sent with the new url. ... In my ReportData() method my App calls targetSink's ReportProgress ... right before calling Start on target APP. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: BUG? With A HTTPModule
    ... querystring is specified but encountered 404 error if request the url ... I tried visit some pages (which is in the root folder of the application) ... both with querystring and without any querystring but seems not encounter ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: HttpWeb Request from Class Library fails to 500
    ... I also used IE UserAgent string. ... querystring that you pass. ... > I agree with Joerg, since the IIS server has received the request, it is ... > some further detailed info on the asp.net page you request... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: adding an item to a QueryString
    ... > It doesn't really make a lot of sense to change a property of a request ... the site use a different stylesheet if "Mode2" is in the Querystring. ... present in the referrer, the value could be propagated at a high level, ...
    (microsoft.public.dotnet.framework.aspnet)

Loading