1.36 <WebKitURISchemeResponse>

Class: <WebKitURISchemeResponse>

It derives from <GObject>.

Represents a URI scheme response.

If you register a particular URI scheme in a <WebKitWebContext>, using web-context:register-uri-scheme, you have to provide a WebKitURISchemeRequestCallback. After that, when a URI response is made with that particular scheme, your callback will be called. There you will be able to provide more response parameters when the methods and properties of a <WebKitURISchemeRequest> is not enough.

When you finished setting up your <WebKitURISchemeResponse>, call webkit_uri_request_finish_with_response() with it to return the response.

Properties

Property: urischeme-response:stream self

The input stream to read from.

Its value is a <GInputStream>, or #f.

It can only be set when the object is made, with #:stream. It cannot be read.

Property: urischeme-response:stream-length self

The input stream length in bytes, -1 for unknown length.

Its value is a 64-bit integer.

It can only be set when the object is made, with #:stream-length. It cannot be read.

Procedures

Procedure: urischeme-response:new input-stream stream-length ⇒ %return

Create a new <WebKitURISchemeResponse>

input-stream

Passed: a <GInputStream>.

a <GInputStream> to read the contents of the request

stream-length

Passed: a 64-bit integer.

the length of the stream or -1 if not known

%return

Returned: a <WebKitURISchemeResponse>.

the newly created <WebKitURISchemeResponse>.

Method: urischeme-response:set-content-type self content-type
Method: set-content-type self content-type

Sets the content type for the self

self

Passed: a <WebKitURISchemeResponse>.

a <WebKitURISchemeResponse>

content-type

Passed: a string.

the content type of the stream

Method: urischeme-response:set-http-headers self headers
Method: set-http-headers self headers

Assign the provided <SoupMessageHeaders> to the response.

headers need to be of the type response. Any existing headers will be overwritten.

self

Passed: a <WebKitURISchemeResponse>.

a <WebKitURISchemeResponse>

headers

Passed: a <SoupMessageHeaders>.

the HTTP headers to be set

Method: urischeme-response:set-status self status-code [reason-phrase]
Method: set-status self status-code [reason-phrase]

Sets the status code and reason phrase for the self.

If status-code is a known value and reason-phrase is #f, the reason-phrase will be set automatically.

self

Passed: a <WebKitURISchemeResponse>.

a <WebKitURISchemeResponse>

status-code

Passed: an unsigned 32-bit integer.

the HTTP status code to be returned

reason-phrase

Passed, or left out: a string, or #f.

a reason phrase