Google Reader API - Mark All As Read
I am trying to write a script which marks all my feed items as read within Google Reader. It should be as simple as posting 4 variables to an API link. However, the only way I can successfully make an HTTP POST to Google without getting a 400 error back is a simple HTML FORM POST as follows. I have tried PHP cURL but I get a 400 error from Google stating I have made a bad client request.

    <form method="post" action="http://www.google.com/reader/api/0/mark-all-as-read">
	   <input type="hidden" name="s" value="user/10408189040522127442/state/com.google/reading-list" />
	   <input type="hidden" name="t" value="Your reading list" />
	   <input type="hidden" name="ts" value="<?php echo time(); ?>" />
	   <input type="hidden" name="T" value="<?php session_start(); echo $_SESSION['token']; ?>" />                
       <input type="button" value="Mark All As Read" /></form>

Submitting the same details using an HTML FORM (as I tried with cURL) works fine, successfully marking all items as read but because the FORM ACTION is set to an external site, you are redirected to it upon submission. To get around this I tried to do an AJAX FORM submission with the following, so there is no redirection but this doesn't work and nothing is submitted.

    $(document).ready(function(){
		$("input[type=button]").click(function() {
			$.post($('form').attr("action"), $('form').formSerialize()); 
		});
	});

Can anyone advise?
1) Why does a cURL POST not work but a simple HTML FORM POST does?
2) Why can't I (silently) submit the HTML FORM with an AJAX submission?
Google Reader API - Mark All As Read
===

I am trying to write a script which marks all my feed items as read within Google Reader. It should be as simple as posting 4 variables to an API link. However, the only way I can successfully make an HTTP POST to Google without getting a 400 error back is a simple HTML FORM POST as follows. I have tried PHP cURL but I get a 400 error from Google stating I have made a bad client request.

    <form method="post" action="http://www.google.com/reader/api/0/mark-all-as-read">
	   <input type="hidden" name="s" value="user/10408189040522127442/state/com.google/reading-list" />
	   <input type="hidden" name="t" value="Your reading list" />
	   <input type="hidden" name="ts" value="<?php echo time(); ?>" />
	   <input type="hidden" name="T" value="<?php session_start(); echo $_SESSION['token']; ?>" />                
       <input type="button" value="Mark All As Read" /></form>

Submitting the same details using an HTML FORM (as I tried with cURL) works fine, successfully marking all items as read but because the FORM ACTION is set to an external site, you are redirected to it upon submission. To get around this I tried to do an AJAX FORM submission with the following, so there is no redirection but this doesn't work and nothing is submitted.

    $(document).ready(function(){
		$("input[type=button]").click(function() {
			$.post($('form').attr("action"), $('form').formSerialize()); 
		});
	});

Can anyone advise?
1) Why does a cURL POST not work but a simple HTML FORM POST does?
2) Why can't I (silently) submit the HTML FORM with an AJAX submission?