티스토리 뷰

SWDesk

[PHP, Python] JSON Test

inhae 2021. 7. 10. 23:30

<on PHP>

		echo "Testing JSON ...";
		$jsonString = $_POST["JSONList"];
		echo "[JSONString] ".$jsonString."<br>";
		$jsonList_ = json_decode($jsonString, true);
		$jsonList = $jsonList_['JSONList'];
		echo "[JSONList-3]".$jsonList[1];

<on Python>

    modelList2 = []
    modelList2.append("BFAM.MN1")
    modelList2.append("BFAM.MN2")
    modelList2.append("BFAM.MN3")

    modelList3 = {
        "JSONList": modelList2
    }
    param1 = {
        'RequestType': "JSONTest",
        'UserID': userID,
        'UserCode': userCode,
        'JSONList': json.dumps(modelList3),
        'CheckQuery': 1
    }

    res1 = requests.post(serverURL, headers=REQUESTHEADER, data=param1)
    print("[Response]", res1.text)

 

 

 

반응형

'SWDesk' 카테고리의 다른 글

[Python] Dataframe to Dict  (1) 2021.08.08
인공지능 스타트업  (0) 2021.07.17
[Android, PHP] JSON Test  (0) 2021.07.07
[Python] Editing Images  (1) 2021.06.30
[Python] Download Google Images  (0) 2021.06.29
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함