7.3 library(http/http_json): HTTP JSON Plugin module
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog HTTP support
        • Supporting JSON
          • library(http/http_json): HTTP JSON Plugin module
            • http_client:http_convert_data/4
            • is_json_content_type/1
            • json_type/1
            • post_data_hook/3
            • http_read_json/2
            • http_read_json/3
            • http_read_json_dict/2
            • http_read_json_dict/3
            • reply_json/1
            • reply_json/2
            • reply_json_dict/1
            • reply_json_dict/2
Availability::- use_module(library(http/http_json)).
Source[det]reply_json(+JSONTerm)
[det]reply_json(+JSONTerm, +Options)
Formulate a JSON HTTP reply. See json_write/2 for details. The processed options are listed below. Remaining options are forwarded to json_write/3.
content_type(+Type)
The default Content-type is application/json; charset=UTF8. charset=UTF8 should not be required because JSON is defined to be UTF-8 encoded, but some clients insist on it.
status(+Code)
The default status is 200. REST API functions may use other values from the 2XX range, such as 201 (created).
json_object(+As)
One of term (classical json representation) or dict to use the new dict representation. If omitted and Term is a dict, dict is assumed. SWI-Prolog Version 7.