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

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

by tssha :: Rate this Message:

Reply to Author | View in Thread

--- In ydn-javascript@..., "jameschao122" <jchao@...> wrote:
>
> 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

You have the correct way to turn off the header and setting your own.

// If you call resetDefaultHeaders here,
// you'll lose the custom header "X-Requested-With:XMLHttpRequest".
YAHOO.util.Connect.resetDefaultHeaders();

// The ability to turn the default POST header was to
// accommodated those who did not want to use this header
// as part of their POST request.
YAHOO.util.Connect.setDefaultPostHeader(false);

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

And, if you are interested:
http://sourceforge.net/tracker/index.php?func=detail&aid=1689122&group_id=165715&atid=836476

Regards,
Thomas

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