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

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.