Web
HTTP
Methods
GET
(Read): Used to retrieve data.POST
(Create): To send data for some processingPATCH
(Update/modify): To modify a record with only the updated part.PUT
(Update/replace): To create or update.DELETE
HEAD
: Like GET but just to get response header (for metadata)CONNECT
: Starts two-way communications with the requested resource. It can be used to open a TCP/IP tunnel.OPTIONS
: To check what HTTP methods are supported by the target systemTRACE
: The TRACE method requests that the target resource transfers the received request in the response body. That way a client can see what (if any) changes or additions have been made by intermediaries.
Mandatory Methods
All general-purpose web servers are required to implement at least the GET
and HEAD
methods, and all other methods are considered optional by the specification.
Response Codes
- Informational responses (
100
–199
) - Successful responses (
200
–299
) - Redirects (
300
–399
) - Client errors (
400
–499
) - Server errors (
500
–599
)
Common Response codes
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not found
- 405 Method Not allowed
- 408 Request Timeout
- 500 Internal Server error
- 502 Bad gateway
JSON
JSON is most favoured message format because:
-
Can be read by any programming language (despite the name)
-
Human and machine readable
-
Lightweight
JSON Schema
Schema language for defining JSON structure and constraints.
Alternatives
- JSON Type Def
- Similar technologies - JSON Schema Org
Usage
How to define enum with description for each constant
CLDF
aka Cross-linguistic data formats
CLDF is a specification describing how to store cross-linguistic data (i.e. data about (many) languages) in a way that maximizes reusability.
- pycldf implements this specification, providing tools to manipulate and validate CLDF datasets, based on csvw which implements the underlying CSVW spec.
Percent-encoding
Method to encode characters which are illegal or reserved in URIs.
- These special characters are denoted using '%' sign followed by two hexadecimal digits.
- These hexadecimal digits are hex version of ASCII codes.
References
HTTP
JSON
CLDF
Percent-encoding