I&nbsp; suppose we should deprecate it eventually, but for now it seems like it would be better to make<br>it clearly a convenience function for modifying the URL,&nbsp; because it seems worse to make it <br>side-effect this params key-value table, in a way which is HTTP-specific, and it doesn&#39;t even actually <br>
&nbsp;cause that query string to appear in the URL for a POST request, which<br>I think it what is confusing people. <br><br><br><br><br><br><div class="gmail_quote">On Jan 22, 2008 3:29 PM, P T Withington &lt;<a href="mailto:ptw@openlaszlo.org">ptw@openlaszlo.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I&#39;m not sure _what_ the pre-4.x behaviour was. &nbsp;I know it was<br>confusing and the source of many bugs. &nbsp;I think the best we could tell<br>
was that the intent was that both API&#39;s manipulate the same thing,<br>although the implementation was perfect.<br><br>I _don&#39;t_ think you should make setQueryString touch the URL. &nbsp;If<br>people want to manipulate the URL they should use the LzURL interface<br>
to do so. &nbsp;The query interface should be for manipulating the query<br>that the dataset is going to make. &nbsp;It seems klunky to me to have the<br>setQueryString API, but I don&#39;t think you can change its contract.<br>The most we could do is deprecate it, because it is too implementation-<br>
specific -- it makes it seem like the dataprovider has to be HTTP.<br><div><div></div><div class="Wj3C7c"><br>On 2008-01-22, at 14:56 EST, Henry Minsky wrote:<br><br>&gt; One thing I am thinking &nbsp;as I look at the code is that &nbsp;the<br>
&gt; &#39;setQueryString&#39;<br>&gt; method is very confusing right now, since it really doesn&#39;t directly<br>&gt; set the<br>&gt; query string. It is really just acting as a synonym for<br>&gt; setQueryParam[s],<br>&gt; which manipulates this &#39;params&#39; table of key value pairs.<br>
&gt;<br>&gt; Maybe we should make setQueryString actually overwrite the src URL<br>&gt; query<br>&gt; string. I think that would be more along the<br>&gt; lines of what people expect, and actually fits our existing<br>&gt; documentation<br>
&gt; more closely.<br>&gt;<br>&gt;<br>&gt; Then setQueryParam[s] would be the only official way<br>&gt; to manipulate the &#39;params&#39; table, and the params data will either be<br>&gt; www-form-encoded as the body of POST requests, or<br>
&gt; merged in with the query string for GET requests. If there are query<br>&gt; string<br>&gt; args that shadow params table args, it is undefined which one has<br>&gt; priority. Or we could make a rule that the params table entries get<br>
&gt; priority. Note, we are still limited by Flash 8 to having no<br>&gt; duplicate query<br>&gt; args in a<br>&gt; SOLO GET request.<br>&gt;<br>&gt; So setQueryString would have slightly different behavior than what<br>&gt; we have<br>
&gt; now, although for GET requests, it would actually be more like &nbsp;the<br>&gt; pre-4.x behavior. For POST requests though, the query string set by<br>&gt; setQueryString would really show up in the URL, and the params<br>
&gt; would show up in the post body.<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; On Jan 21, 2008 8:18 PM, P T Withington &lt;<a href="mailto:ptw@pobox.com">ptw@pobox.com</a>&gt; wrote:<br>
&gt;<br>&gt;&gt; What I was imaginging was in dataprovider API, you get:<br>&gt;&gt;<br>&gt;&gt; + URL (as an LzURL, which may have a non-null query component)<br>&gt;&gt; + queryparams (which may have been set with setQueryString or<br>
&gt;&gt; setQueryParams on the dataset, but not via setSrc)<br>&gt;&gt;<br>&gt;&gt; At that API, the query component of the URL and the queryparams<br>&gt;&gt; object<br>&gt;&gt; have no relation to each other. &nbsp;There should be no need for<br>
&gt;&gt; querystring, since it should be the same as queryparams. &nbsp;The URL<br>&gt;&gt; should come as an LzURL because, as I noted, you ought to be able to<br>&gt;&gt; have a #fragment component of the URL that gets passed on too. &nbsp;If<br>
&gt;&gt; you<br>&gt;&gt; send it as a string, you will just have to re-parse it anyways (at<br>&gt;&gt; least for the HTTP/GET case).<br>&gt;&gt;<br>&gt;&gt; It should be only in the HTTP/GET transport that the queryparams are<br>
&gt;&gt; squeezed into the query component of the URL. For any other protocol,<br>&gt;&gt; and for HTTP/POST, the queryparams are sent along a &#39;control<br>&gt;&gt; channel&#39; (the POST body, for instance).<br>&gt;&gt;<br>
&gt;&gt;<br>&gt;&gt; On 2008-01-21, at 20:00 EST, Henry Minsky wrote:<br>&gt;&gt;<br>&gt;&gt;&gt; I&#39;m looking at how we can preserve the query string so it can remain<br>&gt;&gt;&gt; attached to the URL when making a POST request.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; This requires some hacking at several levels, because &nbsp;while we can<br>&gt;&gt;&gt; (and do)<br>&gt;&gt;&gt; keep the query string and query params separate in the LzDataset,<br>&gt;&gt;&gt; we&#39;re mushing them together into a single url in LZHTTPDataProvider,<br>
&gt;&gt;&gt; and all<br>&gt;&gt;&gt; the levels below that expect a single URL with all the data in it.<br>&gt;&gt;&gt; Unfortunately that extends to the proxy server as well, it expects<br>&gt;&gt;&gt; to see a<br>&gt;&gt;&gt; single query string.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; The reason we&#39;re in trouble here is that a decision &nbsp;early on was<br>&gt;&gt;&gt; made to<br>&gt;&gt;&gt; try to abstract data transport away from<br>&gt;&gt;&gt; HTTP and URLs, etc, and just treat it as key-value pairs, and that<br>
&gt;&gt;&gt; has come<br>&gt;&gt;&gt; back to bite us.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; It extends to our protocol for proxy requests; the protocol we have<br>&gt;&gt;&gt; with the<br>&gt;&gt;&gt; server is to expect a single URL containing all data and query args<br>
&gt;&gt;&gt; mixed<br>&gt;&gt;&gt; together.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; We should probably change the protocol we&#39;re using for proxy data<br>&gt;&gt;&gt; requests,<br>&gt;&gt;&gt; to explicitly pass the data params<br>
&gt;&gt;&gt; separately from the URL. We might be able to get away with reusing<br>&gt;&gt;&gt; the magic<br>&gt;&gt;&gt; &quot;lzpostbody&quot; &nbsp;arg as we do now, but making the<br>&gt;&gt;&gt; policy that the client does not have to send that as the *only<br>
&gt;&gt;&gt; *query arg.<br>&gt;&gt;&gt; The client can instead send the URL with querystring<br>&gt;&gt;&gt; and the server will pluck out the lzpostbody arg if there is one,<br>&gt;&gt;&gt; and use it<br>&gt;&gt;&gt; for the post body, while keeping the rest<br>
&gt;&gt;&gt; of the args as the query string.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; For SOLO requests, we can also use the lzpostbody for the query<br>&gt;&gt;&gt; params;<br>&gt;&gt;&gt; internally in the LFC, the code path for<br>
&gt;&gt;&gt; raw SOLO posts actually keeps the raw post data in a separate var<br>&gt;&gt;&gt; all the<br>&gt;&gt;&gt; way down to where the HTTP request is sent,<br>&gt;&gt;&gt; so we can stick the query params data &nbsp;as a URL-encoded query string<br>
&gt;&gt;&gt; in<br>&gt;&gt;&gt; there.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; I&#39;m going to try making a patch to do this, for wafflecone. I don&#39;t<br>&gt;&gt;&gt; know if<br>&gt;&gt;&gt; it&#39;s worth trying to make a back compatibility flag for<br>
&gt;&gt;&gt; this now, or just say that we&#39;re changing the things work again;<br>&gt;&gt;&gt; people were<br>&gt;&gt;&gt; getting unexpected results when we<br>&gt;&gt;&gt; changed things for 4.x to have setQueryString null out the query<br>
&gt;&gt;&gt; params and<br>&gt;&gt;&gt; vice versa, so maybe just backing out<br>&gt;&gt;&gt; of that behavior is best. Introducing this new behavior which keeps<br>&gt;&gt;&gt; the<br>&gt;&gt;&gt; query string args confined to the URL even<br>
&gt;&gt;&gt; in POST requests seems like a more HTTP/HTML compatible API,<br>&gt;&gt;&gt; considering<br>&gt;&gt;&gt; that XMLHTTPRequest behaves that way;<br>&gt;&gt;&gt; In XMLHTTPRequest, you open a request to a URL, which can have query<br>
&gt;&gt;&gt; string,<br>&gt;&gt;&gt; and then you call send(data) with<br>&gt;&gt;&gt; any POST data you want to stuff in the request body. &nbsp;I feel like we<br>&gt;&gt;&gt; ought<br>&gt;&gt;&gt; to be trying to emulate that model, I don&#39;t see<br>
&gt;&gt;&gt; the point in trying to abstract away from it, we&#39;ve just caused<br>&gt;&gt;&gt; trouble by<br>&gt;&gt;&gt; doing so, so far.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; --<br>&gt;&gt;&gt; Henry Minsky<br>&gt;&gt;&gt; Software Architect<br>&gt;&gt;&gt; <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br>&gt;&gt;<br>
&gt;&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Henry Minsky<br>&gt; Software Architect<br>&gt; <a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br></div></div></blockquote></div><br><br clear="all">
<br>-- <br>Henry Minsky<br>Software Architect<br><a href="mailto:hminsky@laszlosystems.com">hminsky@laszlosystems.com</a><br><br>