Re: Alter querystring through APP
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Fri, 26 Oct 2007 11:55:56 -0400
Max K. <maxkl@xxxxxxxxxxxxx> wrote:
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
This is pseudocode, right? It doesn't make sense as actual code.
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
Move that to Start, right before calling Start on target APP. ReportData
is called multiple times, you don't want to report
BINDSTATUS_REDIRECTING more than once.
m_spInternetProtocolSink->ReportData((BSCF_FIRSTDATANOTIFICATION |
BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE), dwLegth,
dwLegth); //notify target sink of data
You tell the client that data is fully avaialble. Is it? How do you know
it is? What makes you so sure the target APP will give you all the data
in one big chunk? Why don't you just pass along the same parameters you
got?
hr = m_spInternetProtocolSink->ReportResult(S_OK, S_OK, NULL);
Same question - when the first ReportData arrives, what makes you so
sure the result is going to be OK? That the connection won't get dropped
before the next chunk of data makes it to you?
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?
POST requests don't encode form parameters into the URL, but send them
as POST data. What does the <form> tag look like for the form you are
submitting? In particular, what is the method= attribute set to?
If I ignore this problem and have my APP add the querystring to the
URL on the second request
What do you mean by "second request"? I assume there's also a "first"?
How do the two differ?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- Re: Alter querystring through APP
- From: Max K.
- Re: Alter querystring through APP
- References:
- Alter querystring through APP
- From: Max K.
- Alter querystring through APP
- Prev by Date: Alter querystring through APP
- Next by Date: Re: Alter querystring through APP
- Previous by thread: Alter querystring through APP
- Next by thread: Re: Alter querystring through APP
- Index(es):
Relevant Pages
|
|