728x90

VB.net 네이트온 팀룸 API 예제

Imports System
Imports System.Net
Imports System.IO
Imports System.Text.Encoding
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Call Nateon_team()
    End Sub


    Public Sub Nateon_team()
        Dim request As HttpWebRequest
        request = WebRequest.Create("https://teamroom.nate.com/api/webhook/######/##############")
        Dim response As WebResponse
        Dim postData As String = Now
        Dim data As Byte() = UTF8.GetBytes(String.Format("content={0}", System.Web.HttpUtility.UrlEncode(postData)))

        request.Method = "POST"
        request.ContentType = "application/x-www-form-urlencoded"


        Dim stream As Stream = request.GetRequestStream()
        stream.Write(data, 0, data.Length)
        stream.Close()

        response = request.GetResponse()
        Dim sr As New StreamReader(response.GetResponseStream())

        MsgBox(sr.ReadToEnd)
    End Sub

End Class

c# -> VB.net

출처 : http://2nusa.blogspot.com/2017/12/api-c.html

+ Recent posts