Release Notes for 343

HttpService:RequestAsync

Is this what I think it is?

8 Likes

Had the very same thought when I saw that

Ohohoh, RequestAsync? Dark theme? Things are starting to look nice here.

2 Likes

Is it just me, or does pressing ESC not work in studio (play solo and test server)?

2 Likes

This is happening to me too.

Found a bug report and a solution:

1 Like

“Fix an issue with mouse cursor locking in place when holding the right mouse button or middle mouse button down when the CameraType is Scriptable and Lua camera implementations are being used.”
feelsgoodman

2 Likes

Notices studio dark theme isn’t under improvements.

For real though, at least it’s coming. Very happy with what’s to come.

I think you mean

45 Likes

Yup

1 Like

I’m a bit confused on RequestAsync’s function/purpose. Can anyone provide a use case?

2 Likes

This thread might clarify:

1 Like

Previously you could only use GET/POST methods in the HttpService. It wasn’t fully qualified for communicating with RESTful web services. RequestAsync aims to solve this problem!

The function takes a dictionary which accepts the following fields:

Name Type Required Description
Url string Yes The URL being targetted in this request.
Method string No The HTTP method being used by this request.
Headers dictionary No A dictionary of headers to be used with this request. Accepts pretty much any HTTP header (except for Content-Length).
Body string No The body of content being submitted in this request. Can be any string, including binary data. Must be excluded when using the GET/HEAD methods.

The function returns a dictionary containing the following fields:

Name Type Description
Success bool The success status of the request.
StatusCode int The code identifying the status of the response.
StatusMessage string The status message that was sent back.
Headers dictionary A dictionary of headers that were set in this response.
Body Variant The body of content being received back from the server.
18 Likes
  • So are the other methods on track to deprecation?
  • Why is method a string? Aren’t get, post, put, patch, delete, and maybe a few more I forgot the only ones? Wouldn’t it be better as an Enum?
  • Not sure at the moment, it’s certainly possible.
  • Maybe for non-standard methods? ¯\_(ツ)_/¯
2 Likes

Not only are there non-standard headers, but headers can be added to the standard at any time, and I don’t want to have to wait for a Roblox update in order to use them.

6 Likes

@Maximum_ADHD and cowbear16

Any ETA for that sweet HttpService:RequestAsync? I’m assuming a SoonTM, but hey … have to see considering how useful this simple API change will be.

4 Likes

It should be enabled already.

2 Likes

wait wot?

On mobile so can’t test right away, but claims on the Wiki it’s not. Will check asap on desktop

In the past you could not submit requests to the Roblox website, but it appears you now can with RequestAsync, is this intentional or will it be removed?

7 Likes