Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How does HTTP Service work, and whats the usage?

Asked by
yoshi8080 445 Moderation Voter
8 years ago

Well It's time to learn new things, and trying to use HttpService Is one of them, however this one of those topics I don't seem to understand like 100% of it I've checked the wiki. the most helpful examples to know what does what helps the most! <3

1
If you don't know what HttpService would be used for, you probably won't find it useful BlueTaslem 18071 — 8y

1 answer

Log in to vote
3
Answered by 8 years ago
Edited 8 years ago

To understand how HTTP Service works you have to understand that HTTP is a request protocol between client to server. Servers are requested to do things and they output a response usually or change something etc. So HTTP Service essentially posts information to a server and expect.

HTTP Service is not automatically enabled

POST

This posts a JSON table to a site, for this to work you have to have a server set up and code that interpret POST requests.

GET

This returns information based on the website, this is useful if you have something you want your users to see and it's easy to change without going through studio for example. An example of this is Roblox's API it returns json and nothing else so you could decode the GET and essentially create a table out of what Roblox wants to return.

To use HTTP Service you must need knowledge of servers or an API that let's you do this like Trello

0
HTTP is a bit nuanced and difficult to understand from a new programmer's perspective. POST and GET are effectively identical, they just can be told to do different things, and POST has more data allowance in packet sent. adark 5487 — 8y
0
One thing to help understand HTTP is a web browser: It sends HTTP GET packets to the given website, and then tries to render what it is returned. Web browsers understand HTML, which is the format of the text file returned by the GET packet. adark 5487 — 8y
0
It's only HTML if the documents defined as HTML, some get apis return just pure JSON. example is roblox's api view-source:http://api.roblox.com/users/get-by-username?username=devSeldom devSeldom 40 — 8y
Ad

Answer this question