Based on our chat conversation, this code will work:
msg = Soup.Message.new('POST', self.url);
var POSTparams = 'try=this';
msg.set_request ('application/x-www-form-urlencoded', 2, POSTparams, POSTparams.length);
The syntax seems to be:
msg.set_request('MIME type', (2), 'params=here', 'params=here'.length);
This answer was also based on the following:
- How to format the request body and its MIME type
- libsoup POST requests in
C
for the syntax of this function