Basic Idea
This commit is contained in:
parent
e80db3449a
commit
b1d622826f
@ -35,7 +35,7 @@ def init():
|
|||||||
print("starting up... ",)
|
print("starting up... ",)
|
||||||
|
|
||||||
def handle_request_get(requestName, requestType):
|
def handle_request_get(requestName, requestType):
|
||||||
return flask.make_response("{\"message\":Handled}", 200, {"Content-Type": "application/json"})
|
return flask.make_response("{\"message\": \"%s\"}" % "message123123", 200, {"Content-Type": "application/json"})
|
||||||
|
|
||||||
def handle_request_set(requestName, requestType, requestData):
|
def handle_request_set(requestName, requestType, requestData):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -22,14 +22,25 @@ fetch_GetList = (fetchURL) => response = fetch(fetchURL)
|
|||||||
return response.text();
|
return response.text();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
myObj = {
|
||||||
|
'request_name': "Chyron",
|
||||||
|
'request_type': "list"
|
||||||
|
};
|
||||||
|
params = "?request_name="+encodeURIComponent(myObj.request_name)+"&"+"request_type="+encodeURIComponent(myObj.request_type);
|
||||||
|
url = "http://127.0.0.1:5500/api/v1/user_client/get"+params;
|
||||||
|
|
||||||
GetList = async (listType) => {
|
GetList = async (listType) => {
|
||||||
if (listType == "Chyron") {
|
if (listType == "Chyron") {
|
||||||
encodedString = encodeURIComponent({
|
chyronListRequestOBJ = {
|
||||||
'request_name': "Chyron",
|
'request_name': "Chyron",
|
||||||
'request_type': "list"
|
'request_type': "list"
|
||||||
})
|
}
|
||||||
targetURL = 'http://127.0.0.1:5500/api/v1/user_client/get?' + encodedString
|
params = "?request_name="+encodeURIComponent(chyronListRequestOBJ.request_name)+"&"+"request_type="+encodeURIComponent(chyronListRequestOBJ.request_type);
|
||||||
var a = await fetch_GetList(targetURL);
|
targetURL = "http://127.0.0.1:5500/api/v1/user_client/get"+params;
|
||||||
|
console.log(targetURL)
|
||||||
|
a = await fetch_GetList(targetURL);
|
||||||
console.log(a);
|
console.log(a);
|
||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
@ -39,8 +50,10 @@ GetList = async (listType) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function GetListChyron() {
|
async function GetListChyron() {
|
||||||
var returnedList = await GetList("Chyron");
|
returnedList = await GetList("Chyron");
|
||||||
|
obj = JSON.parse(returnedList);
|
||||||
|
console.log(obj["message"])
|
||||||
|
return returnedList
|
||||||
}
|
}
|
||||||
|
|
||||||
GetListChyron();
|
GetListChyron();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user