HaxeFoundation / HaxeFoundation/haxe

More RESTful HTTP handling

Open
#8,614 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Looking at the docs for `haxe.Http` (which is really HttpRequest) and `php.Web` right now, I think there's a bias towards GET and POST requests. Probably because REST wasn't a well known concept when those were created. Some examples:

* You can _send_ a `Http.customRequest` but I don't see how you would handle _receiving_ a new [PUT via PHP](https://www.php.net/manual/en/features.file-upload.put-method.php) or really anything but a GET and POST request.

* There's the unfortunately named `php.Web.getPostData` which actually expects form-encoded data, so it's really `php.Web.getFormData`. It's a nice helper method, but there's nothing inherent to a POST request that wouldn't allow you to send any kind of content, like XML or JSON.

* `haxe.web.Request.getParams` returns "POST parameters", which probably again assumes form-urlencoded data has been sent.

Is it an option to change/expand any of that at this point or is it too late? As is, it looks like Haxe doesn't lend itself to writing a RESTful webservice, at least not with PHP as target. I know PHP isn't "hip" anymore, but I thought I should ask. Maybe I could even help, if there's interest, but I'm not sure if I'm qualified.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.