wizzomafizzo / tapto

Launch games using physical objects
GNU General Public License v3.0
64 stars 9 forks source link

Taptui: An interactive way of making a HTTP POST request #34

Closed sigboe closed 3 months ago

sigboe commented 3 months ago

As discussed in #27 but with the following changes:

I changed to the new (upcoming?) comma separator I added a picker to pick between application/json application/x-www-form-urlencoded and custom

Picking application/json will give you the multiline editor shown in the gif in that issue thread.

Picking x-www-form-urlencoded will come up with a single line text input field, with an example form.

Picking custom will show you a text input field for writing your own ContentType and a separate (single line) input field for writing the data.

Food for thought: (respond to these @wizzomafizzo)

wizzomafizzo commented 3 months ago

It's up to you! I don't mind if you want to leave it for now, there's probably only so much we can do to hand hold a feature like this. I have added some notes in the docs about what characters should be replace with url encoded. It's probably worth adding a more universal escaped sequence (backslash?) that works throughout the commands

I like the template idea, but I honestly don't know what would be good to put as templates right now. How about we keep an eye out if people are using this feature at all

Newlines shouldn't affect anything. But they will technically be wasted space on the token. My preference would be to squash whitespace in the written results and if we want to display it later it can always be pretty printed

sigboe commented 3 months ago

I think I will just go over that the OK/Cancel buttons for the new windows work as the user would expect them to, and then merge the PR.

It's up to you! I don't mind if you want to leave it for now, there's probably only so much we can do to hand hold a feature like this. I have added some notes in the docs about what characters should be replace with url encoded. It's probably worth adding a more universal escaped sequence (backslash?) that works throughout the commands

I have kindly co-opted wget to echo back the URL in encoded format, so that is taken care of, also for http.get

I like the template idea, but I honestly don't know what would be good to put as templates right now. How about we keep an eye out if people are using this feature at all

Yeah good call, just wait to see how people are using it, implement template function then, after that maybe people will suggest more templates.

Newlines shouldn't affect anything. But they will technically be wasted space on the token. My preference would be to squash whitespace in the written results and if we want to display it later it can always be pretty printed

Squashing whitespace is something that should be done outside of this PR. It should be done outside of the area this PR changes. It's a trivial change it doesn't need its own PR. Like one line of code.