0
casper.open('http://some.testserver.com/post.php', {
    method: 'post',
    data: {
      'title': 'Plop',
      'body': 'Wow.',
      'name':'灵感搭'
    }
});

The server needs the name field to be '%C1%E9%B8%D0%B4%EE' (GBK),but the post's field is '%E7%81%B5%E6%84%9F%E6%90%AD'(UTF-8),how can I set it?

4

1 回答 1

0

尝试这个:

casper.open('http://some.testserver.com/post.php', {
    method: 'post',
    data:   {
        'title': 'Plop',
        'body':  '灵感搭'
    },
    headers: {
        'Content-type': 'text/html; charset=utf-8'
    }
});
于 2013-10-24T05:46:37.503 回答