X
X
xverizex2020-04-17 07:42:18
GTK+
xverizex, 2020-04-17 07:42:18

How to get header data in http response?

Attached a handler to webkit_web_view on submit-form signal. I wanted to get the data with the http header, but I did not find an easy way. I tried to get these headers in the same function, but it doesn't work.

static void handler_soup ( const char *name, const char *value, gpointer data ) {
        printf ( "%s: %s\n", name, value );
}

static void web_view_submit_form_cb ( WebKitWebView *webview, WebKitFormSubmissionRequest *request, gpointer data ) {
        printf ( "web_view_submit_form_cb\n" );
        const char *n_uri = webkit_web_view_get_uri ( webview );
        WebKitDownload *wd = webkit_web_view_download_uri ( webview, n_uri );
        WebKitURIResponse *wer = webkit_download_get_response ( wd );
        SoupMessageHeaders *h = webkit_uri_response_get_http_headers ( wer );

        soup_message_headers_foreach ( h, handler_soup, NULL );
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question