Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
50e72f6c
Commit
50e72f6c
authored
Dec 04, 2018
by
Maksim
Browse files
remove httpoison_mock
parent
dd8aee33
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/http/http.ex
View file @
50e72f6c
defmodule
Pleroma
.
HTTP
do
@moduledoc
"""
"""
alias
Pleroma
.
HTTP
.
Connection
alias
Pleroma
.
HTTP
.
RequestBuilder
,
as:
Builder
@doc
"""
Builds and perform http request.
# Arguments:
`method` - :get, :post, :put, :delete
`url`
`body`
`headers` - a keyworld list of headers, e.g. `[{"content-type", "text/plain"}]`
`options` - custom, per-request middleware or adapter options
# Returns:
`{:ok, %Tesla.Env{}}` or `{:error, error}`
"""
def
request
(
method
,
url
,
body
\\
""
,
headers
\\
[],
options
\\
[])
do
options
=
...
...
@@ -43,9 +58,19 @@ def process_request_options(options) do
end
end
@doc
"""
Performs GET request.
See `Pleroma.HTTP.request/5`
"""
def
get
(
url
,
headers
\\
[],
options
\\
[]),
do
:
request
(
:get
,
url
,
""
,
headers
,
options
)
@doc
"""
Performs POST request.
See `Pleroma.HTTP.request/5`
"""
def
post
(
url
,
body
,
headers
\\
[],
options
\\
[]),
do
:
request
(
:post
,
url
,
body
,
headers
,
options
)
end
test/support/httpoison_mock.ex
deleted
100644 → 0
View file @
dd8aee33
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment