Miyuu's Image Board

help:api_read_requests


These are API requests which use the HTTP GET or POST methods.


h4. Limit


Read requests are unlimited for all user levels.


h4. URL parameters


When doing a read through a GET request, the parameters must be passed in through the URL, and must use URL hash encoding (Help:Hash syntax).


h4. Body parameters


When doing a read through a POST request, the parameters must be passed in through the body. See the method override below for more information "[1]":[#dtext-method-override].


h5. URL encoding


These parameters use URL hash encoding (Help:Hash syntax).


* Content-Type:

application/x-www-form-urlencoded


* Format: PARAMETER=VALUE

* Example:
search[name]=test&limit=20_method=get


h5. JSON encoding


These parameters use JSON hash encoding "[2]":[#dtext-external-links].


* Content-Type:

application/json


* Format: { "OBJECT": { "PARAMETER": VALUE } }

* Example:
{ "search": { "name": "test" }, "limit": 20}


h4#method-override. Using POST for GET override


The POST method can be used to send data to endpoints that require the GET method, in such cases where the parameters must be sent in the body, such as the URL limit being exceeded.


h5. URL encoding


Set the parameter

_method
with the value "get".


h5. JSON encoding


Set the

X-HTTP-Method-Override
header with value "get".


h4. See also


* Help:API write requests

* Help:API


h4#external-links. External links


[1] https://www.w3resource.com/JSON/structures.php