-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from paulovieira/paulovieira-patch-1
Update README.md - update domain for Httpbun
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ Run a GET request and see the content. | |
|
||
```sql | ||
SELECT content | ||
FROM http_get('http://httpbun.org/ip'); | ||
FROM http_get('http://httpbun.com/ip'); | ||
``` | ||
``` | ||
content | ||
|
@@ -53,7 +53,7 @@ Run a GET request with an Authorization header. | |
SELECT content::json->'headers'->>'Authorization' | ||
FROM http(( | ||
'GET', | ||
'http://httpbun.org/headers', | ||
'http://httpbun.com/headers', | ||
ARRAY[http_header('Authorization','Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9')], | ||
NULL, | ||
NULL | ||
|
@@ -70,7 +70,7 @@ Read the `status` and `content` fields out of a `http_response` object. | |
|
||
```sql | ||
SELECT status, content_type | ||
FROM http_get('http://httpbun.org/'); | ||
FROM http_get('http://httpbun.com/'); | ||
``` | ||
``` | ||
status | content_type | ||
|
@@ -83,7 +83,7 @@ Show all the `http_header` in an `http_response` object. | |
|
||
```sql | ||
SELECT (unnest(headers)).* | ||
FROM http_get('http://httpbun.org/'); | ||
FROM http_get('http://httpbun.com/'); | ||
``` | ||
``` | ||
field | value | ||
|
@@ -105,7 +105,7 @@ Use the PUT command to send a simple text document to a server. | |
|
||
```sql | ||
SELECT status, content_type, content::json->>'data' AS data | ||
FROM http_put('http://httpbun.org/put', 'some text', 'text/plain'); | ||
FROM http_put('http://httpbun.com/put', 'some text', 'text/plain'); | ||
``` | ||
``` | ||
status | content_type | data | ||
|
@@ -117,7 +117,7 @@ Use the PATCH command to send a simple JSON document to a server. | |
|
||
```sql | ||
SELECT status, content_type, content::json->>'data' AS data | ||
FROM http_patch('http://httpbun.org/patch', '{"this":"that"}', 'application/json'); | ||
FROM http_patch('http://httpbun.com/patch', '{"this":"that"}', 'application/json'); | ||
``` | ||
``` | ||
status | content_type | data | ||
|
@@ -129,27 +129,27 @@ Use the DELETE command to request resource deletion. | |
|
||
```sql | ||
SELECT status, content_type, content::json->>'url' AS url | ||
FROM http_delete('http://httpbun.org/delete'); | ||
FROM http_delete('http://httpbun.com/delete'); | ||
``` | ||
``` | ||
status | content_type | url | ||
--------+------------------+--------------------------- | ||
200 | application/json | http://httpbun.org/delete | ||
200 | application/json | http://httpbun.com/delete | ||
``` | ||
|
||
As a shortcut to send data to a GET request, pass a JSONB data argument. | ||
|
||
```sql | ||
SELECT status, content::json->'args' AS args | ||
FROM http_get('http://httpbun.org/get', | ||
FROM http_get('http://httpbun.com/get', | ||
jsonb_build_object('myvar','myval','foo','bar')); | ||
``` | ||
|
||
To POST to a URL using a data payload instead of parameters embedded in the URL, encode the data in a JSONB as a data payload. | ||
|
||
```sql | ||
SELECT status, content::json->'form' AS form | ||
FROM http_post('http://httpbun.org/post', | ||
FROM http_post('http://httpbun.com/post', | ||
jsonb_build_object('myvar','myval','foo','bar')); | ||
``` | ||
|
||
|
@@ -302,7 +302,7 @@ For such cases you can set the `CURLOPT_USERAGENT` option | |
SELECT http_set_curlopt('CURLOPT_USERAGENT', | ||
'Examplebot/2.1 (+http://www.example.com/bot.html) Contact [email protected]'); | ||
|
||
SELECT status, content::json ->> 'user-agent' FROM http_get('http://httpbun.org/user-agent'); | ||
SELECT status, content::json ->> 'user-agent' FROM http_get('http://httpbun.com/user-agent'); | ||
``` | ||
``` | ||
status | user_agent | ||
|