API Request

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

odawg

Member
May 17, 2023
2
0
1
15
Is there a way to perform an HTTP GET request on a skript?
This is what ChatGPT fed me:
```
on server list ping:
set {_ip} to {player-by-IP::%ip%}
set {_url} to "http://ip-api.com/csv/{_ip}?fields=32825"
set {_output} to http get from {_url}
set the motd to "Most recent player's location: {_output}"
```
Is this correct? If not, how?
 
Is there a way to perform an HTTP GET request on a skript?
This is what ChatGPT fed me:
```
on server list ping:
set {_ip} to {player-by-IP::%ip%}
set {_url} to "http://ip-api.com/csv/{_ip}?fields=32825"
set {_output} to http get from {_url}
set the motd to "Most recent player's location: {_output}"
```
Is this correct? If not, how?
Pure skript doesn't have http requests
 
Is there any extension that can?
SkJson
Code:
(execute|send|make) [new] (POST|GET|PUT|DELETE|MOCK|HEAD|PATCH) request to %string% [(with headers) %-strings/json%] [and with (body|data) %-strings/json%]

(execute|send|make) [new] (POST|GET|PUT|DELETE|MOCK|HEAD|PATCH) request to %string% [with (body|data) %-strings/json%] [and (with headers) %-strings/json%]