Skip to content

Commit

Permalink
Merge pull request #429 from kianmeng/misc-doc-changes
Browse files Browse the repository at this point in the history
Misc doc changes
  • Loading branch information
edgurgel authored Dec 14, 2020
2 parents 1c1c975 + e6b5c8b commit 616d21e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2013-2018 Eduardo Gurgel Pinho
Copyright (c) 2013-present Eduardo Gurgel Pinho

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![](https://i.imgur.com/WwqN8JO.png)
# HTTPoison ![Build Status](https://github.com/edgurgel/httpoison/workflows/CI/badge.svg?branch=master) [![Hex pm](https://img.shields.io/hexpm/v/httpoison.svg?style=flat)](https://hex.pm/packages/httpoison) [![hex.pm downloads](https://img.shields.io/hexpm/dt/httpoison.svg?style=flat)](https://hex.pm/packages/httpoison)
# HTTPoison [![Build Status](https://github.com/edgurgel/httpoison/workflows/CI/badge.svg?branch=master)](https://github.com/edgurgel/httpoison/actions?query=workflow%3ACI) [![Hex pm](https://img.shields.io/hexpm/v/httpoison.svg?style=flat)](https://hex.pm/packages/httpoison) [![hex.pm downloads](https://img.shields.io/hexpm/dt/httpoison.svg?style=flat)](https://hex.pm/packages/httpoison)

HTTP client for Elixir, based on
[HTTPotion](https://github.com/myfreeweb/httpotion)
Expand Down Expand Up @@ -314,7 +314,7 @@ Just throw this in your code before your HTTPoison call and you'll get low-level

## License

Copyright © 2013-2019 Eduardo Gurgel <[email protected]>
Copyright © 2013-present Eduardo Gurgel <[email protected]>

This work is free. You can redistribute it and/or modify it under the
terms of the MIT License. See the LICENSE file for more details.
19 changes: 11 additions & 8 deletions lib/httpoison.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule HTTPoison.Request do
@moduledoc """
`Request` properties:
* `:method` - HTTP method as an atom (`:get`, `:head`, `:post`, `:put`,
`:delete`, etc.)
* `:url` - target url as a binary string or char list
Expand All @@ -10,12 +11,14 @@ defmodule HTTPoison.Request do
* `:params` - Query parameters as a map, keyword, or orddict
`:body`:
* binary, char list or an iolist
* `{:form, [{K, V}, ...]}` - send a form url encoded
* `{:file, "/path/to/file"}` - send a file
* `{:stream, enumerable}` - lazily send a stream of binaries/charlists
`:options`:
* `:timeout` - timeout for establishing a TCP or SSL connection, in milliseconds. Default is 8000
* `:recv_timeout` - timeout for receiving an HTTP response from the socket. Default is 5000
* `:stream_to` - a PID to stream the response to
Expand Down Expand Up @@ -98,15 +101,15 @@ end

defmodule HTTPoison.MaybeRedirect do
@moduledoc """
If the option `:follow_redirect` is given to a request, HTTP redirects are automatically follow if
the method is set to `:get` or `:head` and the response's `status_code` is `301`, `302` or `307`.
If the option `:follow_redirect` is given to a request, HTTP redirects are automatically follow if
the method is set to `:get` or `:head` and the response's `status_code` is `301`, `302` or `307`.
If the method is set to `:post`, then the only `status_code` that get's automatically
followed is `303`.
If the method is set to `:post`, then the only `status_code` that get's automatically
followed is `303`.
If any other method or `status_code` is returned, then this struct is returned in place of a
`HTTPoison.Response` or `HTTPoison.AsyncResponse`, containing the `redirect_url` to allow you
to optionally re-request with the method set to `:get`.
If any other method or `status_code` is returned, then this struct is returned in place of a
`HTTPoison.Response` or `HTTPoison.AsyncResponse`, containing the `redirect_url` to allow you
to optionally re-request with the method set to `:get`.
"""

defstruct status_code: nil, request_url: nil, request: nil, redirect_url: nil, headers: []
Expand All @@ -132,7 +135,7 @@ defmodule HTTPoison do
@moduledoc """
The HTTP client for Elixir.
The `HTTPoison` module can be used to issue HTTP requests and parse HTTP responses to arbitrary urls.
The `HTTPoison` module can be used to issue HTTP requests and parse HTTP responses to arbitrary URLs.
iex> HTTPoison.get!("https://api.github.com")
%HTTPoison.Response{status_code: 200,
Expand Down
11 changes: 5 additions & 6 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
defmodule HTTPoison.Mixfile do
use Mix.Project

@description """
Yet Another HTTP client for Elixir powered by hackney
"""
@description "Yet Another HTTP client for Elixir powered by hackney"
@source_url "https://github.com/edgurgel/httpoison"

def project do
[
Expand All @@ -14,7 +13,7 @@ defmodule HTTPoison.Mixfile do
description: @description,
package: package(),
deps: deps(),
source_url: "https://github.com/edgurgel/httpoison",
source_url: @source_url,
docs: [
main: "readme",
logo: "logo.png",
Expand Down Expand Up @@ -57,8 +56,8 @@ defmodule HTTPoison.Mixfile do
maintainers: ["Eduardo Gurgel Pinho"],
licenses: ["MIT"],
links: %{
Changelog: "https://github.com/edgurgel/httpoison/blob/master/CHANGELOG.md",
GitHub: "https://github.com/edgurgel/httpoison"
Changelog: @source_url <> "/blob/master/CHANGELOG.md",
GitHub: @source_url
}
]
end
Expand Down

0 comments on commit 616d21e

Please sign in to comment.