Did you know ... | Search Documentation: |
Pack canny_tudor -- prolog/gh/api.pl |
You need a personal access token for updates. You do not require them for public access.
json_object(dict)
in
Options. Reply is the updated Gist in JSON on success.
The example below illustrates a Gist update using a JSON term.
Notice the doubly-nested json/1 terms. The first sets up the HTTP
request for JSON while the inner term specifies a JSON object
payload. In this example, the update adds or replaces the cov.json
file with content of "{}" as serialised JSON. Update requests for
Gists have a files
object with a nested filename-object comprising
a content string for the new contents of the file.
ghapi_update_gist( ec92ac84832950815861d35c2f661953, json(json([ files=json([ 'cov.json'=json([ content='{}' ]) ]) ])), _, []).
ghapi_get([gists, ec92ac84832950815861d35c2f661953], A, []).
Supports all HTTP methods despite the predicate name. The "get" mirrors the underlying http_get/3 method which also supports all methods. POST and PATCH send data using the post/1 option and override the default HTTP verb using the method/1 option. Similarly here.
Handles authentication via settings, and from the system environment indirectly. Option ghapi_access_token/1 overrides both. Order of overriding proceeds as: option, setting, environment, none. Empty atom counts as none.
Abstracts away the path using path components. Argument PathComponents is an atomic list specifying the URL path.