[SOLVED] Ajax subscribe api

Hi,

I know this is an old post - but I’m having fun trying to get the form to sub via an ajax request. The normal signup form is:

https://test.com/newsletter/lists/?p=subscribe&id=1

The list ID is 2 ( https://test.com/newsletter/lists/admin/?page=editlist&id=2 for the admin area)

my Javascript looks like:

window.reqwest({
        url: '/newsletter/lists/',
        type: 'json',
        method: 'post',
        data: { 'id': 1, 'subscribe': 'subscribe', 'p': 'asubscribe', 'email': 'andy.newby@gmail.com', 'list': {'2': 'signup'} },
        error: function (err) {
            alert("There was an error: " + err)
        },
        success: function (data) {


        }
    });

When I run it, I get the following request:

id 1
subscribe subscribe
p asubscribe
email andy.newby@gmail.com
list[2] signup

This returns a page like:

What am I doing wrong?

Thanks

Andy