Gitea.Http (gitea v1.1.11)
Documentation for the HTTP
"verb" functions.
Should be self-explanatory.
Each function documented & typespecd.
If anything is unclear, please open an issue:
github.com/dwyl/gitea/issues
Link to this section Summary
Functions
delete/1
accepts a single argument url
;
the url
for the repository to be deleted.
get/1
accepts one argument: url
the REST API endpoint.
Makes an HTTP GET
request to the specified url
.
Auth Headers and Content-Type are implicit.
returns {:ok, map}
get_raw/1
as it's name suggests gets the raw data
(expects the reponse to be plaintext not JSON)
accepts one argument: url
the REST API endpoint.
Makes an HTTP GET
request to the specified url
.
Auth Headers and Content-Type are implicit.
returns {:ok, map}
inject_poison/0
injects a TestDouble of HTTPoison in Test.
see: https://github.com/dwyl/elixir-auth-google/issues/35
parse_body_response/1
parses the response returned by the Gitea Server
so your app can use the resulting JSON.
post/2
accepts two arguments: url
and params
.
Makes an HTTP POST
request to the specified url
passing in the params
as the request body.
Auth Headers and Content-Type are implicit.
post_raw_html/2
accepts two arguments: url
and raw_markdown
.
Makes an HTTP POST
request to the specified url
passing in the params
as the request body.
Does NOT attempt to parse the response body as JSON.
Auth Headers and Content-Type are implicit.
Link to this section Functions
delete(url)
delete/1
accepts a single argument url
;
the url
for the repository to be deleted.
get(url)
get/1
accepts one argument: url
the REST API endpoint.
Makes an HTTP GET
request to the specified url
.
Auth Headers and Content-Type are implicit.
returns {:ok, map}
get_raw(url)
get_raw/1
as it's name suggests gets the raw data
(expects the reponse to be plaintext not JSON)
accepts one argument: url
the REST API endpoint.
Makes an HTTP GET
request to the specified url
.
Auth Headers and Content-Type are implicit.
returns {:ok, map}
inject_poison()
inject_poison/0
injects a TestDouble of HTTPoison in Test.
see: https://github.com/dwyl/elixir-auth-google/issues/35
parse_body_response(arg)
parse_body_response/1
parses the response returned by the Gitea Server
so your app can use the resulting JSON.
post(url, params \\ %{})
post/2
accepts two arguments: url
and params
.
Makes an HTTP POST
request to the specified url
passing in the params
as the request body.
Auth Headers and Content-Type are implicit.
post_raw_html(url, raw_markdown)
post_raw_html/2
accepts two arguments: url
and raw_markdown
.
Makes an HTTP POST
request to the specified url
passing in the params
as the request body.
Does NOT attempt to parse the response body as JSON.
Auth Headers and Content-Type are implicit.