Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Feature: Send HTTP POST request #23

Open
Makar8000 opened this issue Mar 22, 2019 · 8 comments
Open

Feature: Send HTTP POST request #23

Makar8000 opened this issue Mar 22, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@Makar8000
Copy link

It would be nice if an advanced option would be added to send an HTTP POST request to a configured URL, so that we can customize our own behavior when an action happens. Example use cases include sending push notifications, discord messages, etc.

@Jaehyuk-Lee Jaehyuk-Lee added the enhancement New feature or request label Mar 22, 2019
@Jaehyuk-Lee
Copy link
Owner

I was planning restoring twitter alarm feature. But as that feature requires a server, I think your idea is better for now. I'm in bad circumstances to have my own server now.
I'll add HTTP POST request feature later, expecting to add it in 2 months.

@Jaehyuk-Lee
Copy link
Owner

I'm planning to send request on duty matched and fate occured.
Sends status (duty-matched or fate-occured) and info(duty name or fate name)
I think if users need additional custom request like discord ID or twitter ID, add those information on url and get GET request is better to customize variously.

Also, I think sending POST 'status' String like duty-matched or fate-occured is better than sending status code like 10(on duty) or 20(on fate). How do you think?

@Jaehyuk-Lee
Copy link
Owner

I thought I could do POST and GET simultaneously by adding like http://{URL}?var1=var1 in the back of the url, but they are not seem to work.(I've tested server in node.js. Maybe it could work in PHP.)
I've finished POST function and refining it now.
I'm concerning about how to send more parameters to custom target server like I've written before about discord ID or twitter account.

@Jaehyuk-Lee
Copy link
Owner

I'm planning to release new version tomorrow or the day after tomorrow.

This feature will display like this.

제목 없음

제목 없음2

"name":"name" will be "name":"{instance.Name}" or "name":"{fate.Name}" when it's working on real situation. (I was testing it, I cannot execute game in this situation.)

Below, sample code I used for test in node.js.

const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

let PORT = 3000;

app.post('/test-page', function(req, res) {
    var status = req.body.status,
        name = req.body.name;
    if(status == "duty-matched")
        console.log(name + " matched!");
    else if(status == "fate-occured")
        console.log(name + " occured!");
    res.send("response!");
});

app.listen(PORT, function(){
    console.log("Listening to port " + PORT);
})

@Makar8000
Copy link
Author

Makar8000 commented Mar 22, 2019

Well, one idea would be to have some kind of .json file that specifies additional params to add to your request. Another idea that is more UI based would be to have some kind of item list (similar to REST clients like Postman)

Also, thanks for looking into this idea. It is greatly appreciated!

@Jaehyuk-Lee
Copy link
Owner

I've released a new version, but I think function and UI have to be improved much more. So, I'll keep this issue opened.

@Jaehyuk-Lee
Copy link
Owner

@Makar8000 I thought that Postman item list would be great, but I couldn't find anything like that in Windows Form components. What I'm thinking now is to use combo box with add button and delete button. Editable textbox aside to edit.
I'm thinking like this.
this

@Makar8000
Copy link
Author

That seems like a good alternative to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants