blob: daa653a3462e8c7e0419d2ab86d10149c33a882e (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
import React, {useState, useRef} from 'react';
function SECAPIData() {
const [filedAt, setFiledAt] = useState("");
const [xml, setXML] = useState("");
const requestData = () => {
const toSend = {
filedAt : filedAt,
xml : xml,
};
let axiosConfig = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
"Access-Control-Allow-Origin": "*",
}
};
axios({
method: 'post',
url: 'http://localhost:4567/',
headers: axiosConfig,
data: toSend
})
.then(response => {
})
.catch(function (error) {
console.log(error);
});
}
return (
<div>
<h1 >SECAPIData</h1>
<Button onPress={requestData}>GETDATA</Button>
</div>
);
}
export default SECAPIData;
|