Skip to main content

Call Bitcode Function

GET 

/qlibs/:qlibid/q/:qhit/call/:func

Call the given bitcode function and return its result.

The function name as well as all parameters are specified in the URL.

The bitcode function will receive as first parameter the QLib ID, as second parameter the content hash, and then the key-value pairs from the URL as a list of tuples.

For example, this URL path:
/qlibs/ilibBif1DV8Yi6fzEqzfDsv9dY/q/hq__QmT3aofVbzmsCL426SNbcXrFxtvX92grdi5UWNvaybPHBq/call/func1?arg1=v1&arg2=v2
produces these arguments:
arg[0] = "ilibBif1DV8Yi6fzEqzfDsv9dY"
arg[1] = "hq__QmT3aofVbzmsCL426SNbcXrFxtvX92grdi5UWNvaybPHBq"
arg[2] = "arg1"
arg[3] = "v1"
arg[4] = "arg2"
arg[5] = "v2"

If the function call returns nothing, the request is HTTP answered with a 200 status code and no body.

Otherwise the function is expected to return the content type as first return argument, and additional information according to the content type. Two types are supported: application/octet-stream and application/json

  • application/octet-stream: expects only a single additional argument: the binary content.

  • application/json: accepts a list of additional key-value pairs. They will be marshaled to a standard json object.

Request

Responses

The result of a bitcode call.

Response Headers
    Content-Type

    the returned content type

    Content-Disposition

    the content disposition if available