01.
<%@ Page Language=
"VB"
AutoEventWireup=
"True"
%>
02.
<%@ Import
Namespace
=
"System.Globalization"
%>
03.
<%@ Import
Namespace
=
"System.Net"
%>
04.
<head>
05.
<script language=
"VB"
runat=
"server"
>
06.
07.
Sub
btnline1_Click(sender
As
Object
, e
As
EventArgs)
08.
10.
Dim
postData =
String
.Format(
"message={0}"
,
"ทดสอบ line notify asp.net"
)
11.
Dim
data = Encoding.UTF8.GetBytes(postData)
12.
13.
request.Method =
"POST"
14.
request.ContentType =
"application/x-www-form-urlencoded"
15.
request.ContentLength = data.Length
16.
request.Headers.Add(
"Authorization"
,
"Bearer code token"
)
17.
18.
Using stream = request.GetRequestStream()
19.
stream.Write(data, 0, data.Length)
20.
End
Using
21.
22.
Dim
response =
DirectCast
(request.GetResponse(), HttpWebResponse)
23.
Dim
responseString =
New
StreamReader(response.GetResponseStream()).ReadToEnd();
24.
25.
End
Sub
26.
27.
</script>
28.
29.
</head>
30.
<body>
31.
32.
<form id=
"form1"
runat=
"server"
>
33.
<asp:Button id=
"btnline1"
onclick=
"btnline1_Click"
runat=
"server"
Text=
"Line"
></asp:Button>
34.
35.
36.
</form>
37.
</body>
38.
</html>