Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjhaid/fake_http
https://github.com/bjhaid/fake_http
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bjhaid/fake_http
- Owner: bjhaid
- Created: 2014-09-20T14:06:07.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-22T17:16:02.000Z (about 10 years ago)
- Last Synced: 2023-03-11T22:07:40.182Z (over 1 year ago)
- Language: Elixir
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
FakeHttp
========FakeHttp is a fake http endpoint
### Usage
Start FakeHttp
```
> FakeHttp.start
true
```Ask it for what url it is running on
```
> FakeHttp.url
"http://localhost:2000"
```Call the URL
```
curl -d "hey" "http://localhost:2000?foo=bar"
curl -d "hi" "http://localhost:2000?foo=bar&bar=foo"
```Ask FakeHttp questions
```
> FakeHttp.messages
["hey", "hi"]
> FakeHttp.last_message
"hi"
> FakeHttp.headers
[["user-agent": "curl/7.30.0", host: "localhost:2000", "content-length": "3",
"content-type": "application/x-www-form-urlencoded"],
["user-agent": "curl/7.30.0", host: "localhost:2000", "content-length": "2",
"content-type": "application/x-www-form-urlencoded"]]
> FakeHttp.last_header
["user-agent": "curl/7.30.0", host: "localhost:2000", "content-length": "2",
"content-type": "application/x-www-form-urlencoded"]
> FakeHttp.query_params
[[foo: "bar"], [foo: "bar", bar: "foo"]]
> FakeHttp.last_query_param
[foo: "bar", bar: "foo"]
```### Todos
Add SSL (Https) support