libsoup 3.0: rewriting old Soup.form_request_new_from_hash

122 views Asked by At

I have upgraded Fedora 36 to Fedora 37 with its GNOME 43 support. Now my extention is not working as there is a change in libsoup 3.0.

// libsoup 2.0: works perfectly in GNOME 43, libsoup 2.0 
_httpSession = new Soup.Session();
let message = Soup.form_request_new_from_hash('GET', MY_URL, params);

Now I get this error:

Soup.form_request_new_from_hash is not a function

I can't find any clue how to set this request properly in https://libsoup.org/libsoup-3.0/index.html

Could someone help me?

1

There are 1 answers

0
Alban Browaeys On

For libsoup 3.0, you would do

let message = Soup.Message.new_from_encoded_form('GET', MY_URL, Soup.form_encode_hash(params));