gnunet-handbook

The GNUnet Handbook
Log | Files | Refs

gns.rst (4891B)


      1 GNS
      2 ===
      3 
      4 Error Response
      5 --------------
      6 
      7 An error response is sent in the JSON format: ``{"error":"*error_description*"}``
      8 
      9 Following numbers are added for references inside the documentation only.
     10 
     11 Error descriptions are::
     12     
     13     Nr. Error Description           - Explanation
     14     1)  Unknown Error               - Error is not specified
     15     2)  Record not found            - GNS record was not found, this is combined with the HTTP Error Code 404 Not Found
     16 
     17 Error ``1)`` is always possible and is not listed in following requests.
     18 
     19 Requests
     20 ~~~~~~~~
     21 
     22 GET Request
     23 -----------
     24 
     25 For this request ``record_type`` is optional. If missing or called with an invalid record_type, it will automatically be set to ANY.
     26 
     27 
     28 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     29 |**Title**           |Return all records for given name                                                                                           |
     30 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     31 |**URL**             |:literal:`/gns/'lookup'?record_type='type'`                                                                                 |
     32 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     33 |**Method**          |**GET**                                                                                                                     |
     34 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     35 |**Data Params**     |none                                                                                                                        |
     36 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     37 |**Success Response**| [{"value": "*value*", "record_type": "*type*", "expiration_time": "*time*", "flag": *flag*},...]                           |
     38 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     39 |**Error Response**  | {"error":"*error_desc*"} :sup:`2`                                                                                          |
     40 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     41 
     42 OPTIONS Request
     43 ---------------
     44 
     45 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     46 |**Title**           |Get request options                                                                                                         |
     47 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     48 |**URL**             |:literal:`/gns`                                                                                                             |
     49 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     50 |**Method**          |**OPTIONS**                                                                                                                 |
     51 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     52 |**URL Params**      |none                                                                                                                        |
     53 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     54 |**Data Params**     |none                                                                                                                        |
     55 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     56 |**Success Response**|                                                                                                                            |
     57 +--------------------+----------------------------------------------------------------------------------------------------------------------------+
     58 |**Error Response**  |none                                                                                                                        |
     59 +--------------------+----------------------------------------------------------------------------------------------------------------------------+