Skip to content

Instantly share code, notes, and snippets.

@glinesbdev
Last active April 23, 2023 20:30
Show Gist options
  • Save glinesbdev/cb614e82060bc29ed3dd444013a67024 to your computer and use it in GitHub Desktop.
Save glinesbdev/cb614e82060bc29ed3dd444013a67024 to your computer and use it in GitHub Desktop.
Emojicode - JSON HTTP Request
๐Ÿ“œ ๐Ÿ”คrequest.emojic๐Ÿ”ค
๐Ÿ ๐Ÿ‡
๐Ÿ†•๐Ÿ—บ๏ธ ๐Ÿ”คjsonplaceholder.typicode.com๐Ÿ”ค ๐Ÿ”ค/todos/1๐Ÿ”คโ— โžก๏ธ request
๐Ÿ†— ๐Ÿš€requestโ— ๐Ÿ‡
๐Ÿ’ชrequestโ— โžก๏ธ body
๐Ÿ˜€ bodyโ—
๐Ÿ‰
๐Ÿ™… error ๐Ÿ‡
๐Ÿ˜€ ๐Ÿ’ฌerrorโ—โ—
๐Ÿ‰
๐Ÿ‰
๐Ÿ“œ ๐Ÿ”คsocket.emojic๐Ÿ”ค
๐Ÿ’ญ A wrapper around an HTTP request
๐Ÿ‡ ๐Ÿ—บ๏ธ ๐Ÿ‡
๐Ÿ–๏ธ๐Ÿ†• url ๐Ÿ”ก
๐Ÿ–๏ธ๐Ÿ†• path ๐Ÿ”ก
๐Ÿ–๏ธ๐Ÿ†• port ๐Ÿ”ข
๐Ÿ–๏ธ๐Ÿ†• method ๐Ÿ”ก
๐Ÿ–๏ธ๐Ÿ†• headers ๐Ÿ”ก
๐Ÿ–๏ธ๐Ÿ†• response ๐Ÿ”ก
๐Ÿ†• ๐Ÿผ method ๐Ÿ”ก ๐Ÿผ url ๐Ÿ”ก ๐Ÿผ port ๐Ÿ”ข ๐Ÿผ path ๐Ÿ”ก ๐Ÿผ headers ๐Ÿ”ก ๐Ÿ‡
๐Ÿ”ค๐Ÿ”ค โžก๏ธ ๐Ÿ–๏ธresponse
๐Ÿ‰
๐Ÿ†• ๐Ÿผ url ๐Ÿ”ก ๐Ÿผ path ๐Ÿ”ก ๐Ÿผ headers ๐Ÿ”ก ๐Ÿ‡
๐Ÿ”คGET๐Ÿ”ค โžก๏ธ ๐Ÿ–๏ธmethod
80 โžก๏ธ ๐Ÿ–๏ธport
๐Ÿ”ค๐Ÿ”ค โžก๏ธ ๐Ÿ–๏ธresponse
๐Ÿ‰
๐Ÿ†• ๐Ÿผ url ๐Ÿ”ก ๐Ÿผ path ๐Ÿ”ก ๐Ÿ‡
๐Ÿ”คGET๐Ÿ”ค โžก๏ธ ๐Ÿ–๏ธmethod
80 โžก๏ธ ๐Ÿ–๏ธport
๐Ÿ”ค๐Ÿ”ค โžก๏ธ ๐Ÿ–๏ธheaders
๐Ÿ”ค๐Ÿ”ค โžก๏ธ ๐Ÿ–๏ธresponse
๐Ÿ‰
โ— ๐Ÿš€ ๐Ÿšง๐Ÿšง๐Ÿ”ธโ†•๏ธ ๐Ÿ‡
๐Ÿ†•๐Ÿงฆ method url port path headersโ— โžก๏ธ sock
๐Ÿ”บโ˜Ž๏ธsockโ— โžก๏ธ socket
๐Ÿ”บ๐Ÿ“–sock socketโ—
๐Ÿ”บ๐Ÿ‘‚socket 10000โ— โžก๏ธ data
โ†ช๏ธ ๐Ÿ”กdataโ— โžก๏ธ data_str ๐Ÿ‡
data_str โžก๏ธ ๐Ÿ–๏ธresponse
๐Ÿ‰
๐Ÿ‰
โ— ๐Ÿ’ช โžก๏ธ ๐Ÿ”ก ๐Ÿ‡
โ†ฉ๏ธ ๐Ÿฝ๐Ÿ”ซresponse ๐Ÿ”คโŒrโŒnโŒrโŒn๐Ÿ”คโ— 1โ—
๐Ÿ‰
๐Ÿ‰
๐Ÿ“ฆ sockets ๐Ÿ 
๐Ÿ’ญ A wrapper around a TCP socket
๐Ÿ•Š๏ธ ๐Ÿงฆ ๐Ÿ‡
๐Ÿ–๏ธ๐Ÿ†• url ๐Ÿ”ก
๐Ÿ–๏ธ๐Ÿ†• path ๐Ÿ”ก
๐Ÿ–๏ธ๐Ÿ†• port ๐Ÿ”ข
๐Ÿ–๏ธ๐Ÿ†• method ๐Ÿ”ก
๐Ÿ–๏ธ๐Ÿ†• headers ๐Ÿ”ก
๐Ÿ†• ๐Ÿผ method ๐Ÿ”ก ๐Ÿผ url ๐Ÿ”ก ๐Ÿผ port ๐Ÿ”ข ๐Ÿผ path ๐Ÿ”ก ๐Ÿผ headers ๐Ÿ”ก ๐Ÿ‡๐Ÿ‰
โ— โ˜Ž๏ธ โžก๏ธ ๐Ÿ“ž ๐Ÿšง๐Ÿšง๐Ÿ”ธโ†•๏ธ ๐Ÿ‡
โ†ฉ๏ธ๐Ÿ”บ๐Ÿ†•๐Ÿ“ž url portโ—
๐Ÿ‰
โ— ๐Ÿ“– socket ๐Ÿ“ž ๐Ÿšง๐Ÿšง๐Ÿ”ธโ†• ๐Ÿ‡
๐Ÿ“‡ ๐Ÿ”ค๐Ÿงฒmethod๐Ÿงฒ ๐Ÿงฒpath๐Ÿงฒ HTTP/1.1โŒrโŒnHost: ๐Ÿงฒurl๐ŸงฒโŒrโŒn๐Ÿงฒheaders๐ŸงฒโŒrโŒnโŒrโŒn๐Ÿ”คโ— โžก๏ธ request
๐Ÿ”บ๐Ÿ’ฌsocket requestโ—
๐Ÿ‰
๐Ÿ‰
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment