GogsHttp (gogs v0.9.0)
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/gogs/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 Gogs 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.
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 Gogs 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.