« Return to Thread: Post params don't show up on server side

Re: Post params don't show up on server side

by jameschao122 :: Rate this Message:

Reply to Author | View in Thread

OK, seems like the problem is with the "Content-Type" header.

By default, it is "application/x-www-form-urlencoded; charset=UTF-8".

When I change it to "application/x-www-form-urlencoded", it works.

Does anybody know if this is the right way to do it or why the default
value doesn't work??

BTW, this is the code I'm doing to change the header:

YAHOO.util.Connect.setDefaultPostHeader(false);
YAHOO.util.Connect.initHeader('Content-Type',
'application/x-www-form-urlencoded');



--- In ydn-javascript@..., "jameschao122" <jchao@...> wrote:

>
> Hi,
>
> I currently switched over from prototype to YUI and have some problems
> using the connection manager.
>
> I'm using the POST method with some parameters, but when my async
> connection is sent, the server side only receives some parameters in
> the URL, but not the ones that I pass into the 4th argument of
> asyncRequest. (I'm using Apache ASP on the server).
>
> Another related thing I noticed is that the Params tab don't show up
> for these requests either, and the "Post" tab shows the parameters as
> a single long string, rather than a key-value column like it did when
> I was using prototype.js. This was the way when I was looking at the
> official YUI Post method example as well.
>
> Any ideas what I'm doing wrong?
>
> James
>

 « Return to Thread: Post params don't show up on server side