Hi Thomas,
I'm using Apache::ASP and it seems like the problem lies with that.
According to
http://www.nabble.com/Content-type:-application-x-www-form-urlencoded--c\
harset%3Dutf-8-t1834467.html, it seems like Apache::ASP expects the
content type to be exactly "application-x-www-form-urlencoded", even
though the HTTP specs allow for more than that.
So, I'll just have to live with the workaround I've found. It would be
nice if there was a better API for changing this though (or am I using
the APIs incorrectly?). Honestly, a bit surprised that this Content-Type
header things hasn't been a problem for more people though...
Anyway, thanks for following up.
James
--- In
ydn-javascript@..., "jameschao122" <jchao@...> wrote:
>
> Also, I actually have to do the following to get the connection
manager
> to send the request with the correct header:
>
> YAHOO.util.Connect.resetDefaultHeaders();
> YAHOO.util.Connect.setDefaultPostHeader(false);
> YAHOO.util.Connect.initHeader('Content-Type',
> 'application/x-www-form-urlencoded', true);
>
>
> --- In
ydn-javascript@..., "jameschao122" jchao@ wrote:
> >
> > My post parameters look something like this:
> >
> > "id=1180625935031062&action=get_user_prefs&data=%7B%7D"
> >
> > All of my posts have a parameter for ID, action, and data (sometimes
> > null). And this is exactly what I'm passing in as the fourth
> parameters.
> >
> > --- In
ydn-javascript@..., "tssha" tsha@ wrote:
> > >
> > > --- In
ydn-javascript@..., "jameschao122" jchao@
wrote:
> > > >
> > > > 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');
> > >
> > > Interesting. Can you show the actual POST message you're sending
as
> > > the fourth argument?
> > >
> > > Regards,
> > > Thomas
> > >
> >
>