Toggle navigation
Toggle navigation
This project
Loading...
Sign in
윤규리
/
emergency_room_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
shin0112
2022-11-18 16:15:11 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
86e9ab01e6b02c8a98c2776901d029758667af47
86e9ab01
1 parent
b2f34e79
add file emergency_api.js
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
emergency_api.js
emergency_api.js
0 → 100644
View file @
86e9ab0
const
request
=
require
(
'request'
);
const
convert
=
require
(
"xml-js"
);
var
url
=
'http://apis.data.go.kr/B552657/ErmctInfoInqireService/getEmrrmRltmUsefulSckbdInfoInqire'
;
var
queryParams
=
'?'
+
encodeURIComponent
(
'serviceKey'
)
+
'=52tXHgaW46YUpGn9k0r3IQrduIl6kBOl3Ta8Idra1%2BpPMYhL4qVCDu9itW8FVbDtMF4f9LAT9NJXEx7pvEJv%2FQ%3D%3D'
;
/* Service Key*/
queryParams
+=
'&'
+
encodeURIComponent
(
'STAGE1'
)
+
'='
+
encodeURIComponent
(
'¼¿ïƯº°½Ã'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'STAGE2'
)
+
'='
+
encodeURIComponent
(
'°³²±¸'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'pageNo'
)
+
'='
+
encodeURIComponent
(
'1'
);
/* */
queryParams
+=
'&'
+
encodeURIComponent
(
'numOfRows'
)
+
'='
+
encodeURIComponent
(
'10'
);
/* */
request
({
url
:
url
+
queryParams
,
method
:
'GET'
},
function
(
err
,
res
,
body
)
{
if
(
err
){
console
.
log
(
`err =>
${
err
}
`
)
}
console
.
log
(
convert
.
xml2js
(
body
));
});
\ No newline at end of file
Please
register
or
login
to post a comment