HttpService Custom Headers Are Now Live

So a more direct google analytics?

2 Likes

If you do please let me know how, if you are willing.

Investigating GameAnalytics.com now. Woo.

3 Likes

The test I ran to make sure it works was actually communicating with GameAnalytics.com. It used default values, because I didn’t want to write whatever SHA hash something conversion for authentication in Lua. If you ever get that working you should let me know. :wink:

3 Likes

Can anyone explain what this actually means? I’ve used httpservice with my database, but beyond what I had to learn with that, I don’t know about interacting with websites. What can headers do?

I’m interested in getting this working too, so I put together some stuff I found on the internet to get authentication working. Here is a model.

I got the test string working, so this should be able to get authentication in general working. This uses lockbox for HMAC and SHA2-256, and bit numberlua for the bit library.

Also, @Ozzypig since you’re probably interested as well.

3 Likes

Basically for website logins and apis, they use the Authorization header, so basically for an example, you could use some of Discord’s APIs using that header. so you could send messages or something to discord.

Another good example of what could be possible, is integration with twitch.

Thanks for the explanation, though Im not too sure what it means yet. Is this basically a way of sending data to specific parts of a page that you couldnt before, like filling in a username/password?

1 Like

Its similar to sending post data but not through a form. Think of them like parameters to a HTTP request where you can define any of them and not in any particular order.
For instance, some web requests use Authorization header with an authentication token to verify the sender and some use the Accept header to tell it the format to respond with, so sending “application/json” as the Accept header would request that data is sent back as JSON, even if the default is XML. But allowing for these headers to be used is purely up to the person hosting the server you request from.

If you want to know the current headers:

1 Like

Does the headers table allow for any header, or is there a restriction? If there isn’t a restriction, we should (in theory) be able to use X-HTTP-Method-Override to simulate requests which aren’t GET or POST.

There are a few restrictions. It will properly tell you if you can’t use a specific header if you try to use it.The method override one shouldn’t be on the restricted list.

1 Like

blob.png

Well well well… Hopefully there’s a solution for this already… right?

Edit: This fixed it

:gsub("%%%x%x", function(match) return string.char(tonumber(match:sub(2), 16)) end)

on the auth header

1 Like

This allows you to send the desired header with the ‘%’ character in it for authentication and everything works fine and you’re able to properly authenticate?

The authentication works fine, as far as I’ve tested. Mostly because %?? contains a hexadecimal code for the desired character, as I see it.

Are you guys using the RESTAPI?

Also, Once you guys figure out how to use gameanalytics.com, you guys should open a different thread to show other DEV’s on how to use it!

Yep, Twitter’s REST API. Here’s a model I made.
Also, user NovusTheory says he’s made a module for communicating with gameanalytics.com, although I haven’t seen his module in action :slight_smile:

I think I heard @Ozzypig mention something about him making one for gameanalytics.com

OH MY GOD THIS WILL MAKE THINGS A LOT EASIER. Now I can trash that Http Request proxy idea! Unless … I need to perform multiple http requests at once…

Well, yes but I’m talking about something different. Instead of firing 5 different http requests on ROBLOX, I am making a proxy which will send one request to my server, and have the server perform the 5 requests and return the results. Ultimately, it allows me grab more data without using too many requests. It’s something totally different and would probably qualify for a DM if you want to continue this conversation, though probably pointless.