File tree Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -42,21 +42,6 @@ public class FeedbinAPI : Object {
4242 {
4343 m_session. user_agent = user_agent;
4444 }
45-
46- m_session. authenticate. connect(authenticate);
47- }
48-
49- ~FeedbinAPI ()
50- {
51- m_session. authenticate. disconnect(authenticate);
52- }
53-
54- private void authenticate (Soup .Message msg , Soup .Auth auth , bool retrying )
55- {
56- if (! retrying)
57- {
58- auth. authenticate(this . username, this . password);
59- }
6045 }
6146
6247 private Soup .Message request (string method , string last_part , string ? input = null ) throws FeedbinError
@@ -68,14 +53,19 @@ public class FeedbinAPI : Object {
6853 var path = m_base_uri + last_part;
6954 var message = new Soup .Message (method, path);
7055
71- if (method == " POST" )
72- {
56+ message. authenticate. connect((auth, retrying) = > {
57+ if (! retrying) {
58+ auth. authenticate(this . username, this . password);
59+ }
60+ });
61+
62+ if (method == " POST" ) {
7363 message. request_headers. append(" Content-Type" , " application/json; charset=utf-8" );
7464 }
7565
76- if (input != null )
77- {
78- message. request_body . append_take( input. data);
66+ if (input != null ) {
67+ // TODO: Figure out MIME type and replace null with it
68+ message. set_request_body_from_bytes ( null , new Bytes ( input. data) );
7969 }
8070
8171 m_session. send_and_read(message);
You can’t perform that action at this time.
0 commit comments