HTTP API Requests

,

Hey!

I just started developing in the Playdate SDK. I Find it very cool so far, but the only feature I am disappointed at not having is HTTP requests.
I am planning on making a weather app and a social media client. I know that you can use playdate.simulator.getURL(url) in the simulator, but I would like more functionality.
Here are some example of requests:

  • playdate.requests.get("https://api.wasteof.money/session", json = {"username": username, "password": password})
  • playdate.requests.post("https://api.wasteof.money/posts", headers = {"token": token, "content": content})
  • And other types of requests, such as PUT, DELETE, PATCH, etc.
4 Likes

It's definitely something we'd like to do, but we need to figure out the best way to do it while balancing performance, security, battery life, and other concerns. Wish I had a better answer!

6 Likes

When could we expect this to be released?

add curl support first in C. I am sure it is the best way to start

1 Like

I'd be interested in being able to make HTTP requests as well.

In the absence of that... is there ANY networking functionality in Playdate SDK that I can get to? Like, can I create and connect a TCP socket (ok, some TLS would be great also; ) in C or Lua (or Rust?; )?

1 Like

In the simulator, there is playdate.simulator.getURL(url)
It doesn't exist on device, but that's the closest thing there is at the moment.

1 Like

Have you considered implementing a gopher protocol client instead of HTTP requests? Since gopher is far more limited it eliminates a lot of security concerns. Plus it fits in with the Playdate's quirky nature in my opinion. Even one of Panic's founders embraces the gopher protocol!

gopher://stevenf.com/0/journal/2022/02/28/playdate-sdk.txt
gopher://stevenf.com/0/journal/2022/04/18/first-playdates-shipping.txt
3 Likes

why would something exist in the simulator but not on the device? That's insane.

No http capability severely limits what I want to build. I thought I finally had a niche place to build LLM or GPT capabilities into a game...

security concerns. for example, a game could record you and upload it to a remote server without your consent or knowledge. they're also trying to balance out battery life issues with it, but it's been over a year since I asked so I have no idea where they are on working on it.

For me at least, it would be totally fine to have local network access (or maybe a HTTP server) for my own in-dev stuff. It certainly would be fun to build a game that uses a database of parameters I could live reload over the network as I'm developing it.

It's already possible to live reload during development, though obviously not over wi-fi.

you might enjoy the approach.

https://devforum.play.date/t/splitting-a-game-into-several-functional-binaries-nics-plugin-manager/1387/5