improve api requests #25

Closed
opened 2024-07-02 15:30:59 +00:00 by lukas · 0 comments
Owner

Build modular api requests with new request function

maybe:

testload(url, fd,  callback){
        const req = new FormData();

        for(const i in fd){
            req.append(i, fd[i]);
        }

        fetch(url, {method: 'POST', body: req})
            .then((response) => response.json()
                .then((result) => {
                    callback(result);
                }));
    }
Build modular api requests with new request function maybe: ``` testload(url, fd, callback){ const req = new FormData(); for(const i in fd){ req.append(i, fd[i]); } fetch(url, {method: 'POST', body: req}) .then((response) => response.json() .then((result) => { callback(result); })); } ```
lukas added the
To Do
label 2024-07-02 15:30:59 +00:00
lukas closed this issue 2024-07-02 15:30:59 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lukas/OpenMediaCenter#25
No description provided.