문제

Get and Post 요청과 함께 온라인 API를 사용하는 프로그램을 개발하고자하며 (사용자에게 웹 페이지를 보지 않고) 프로그램 내에서 요청을 만드는 방법을 알고 싶습니다. 그런 다음 결과를 프로그램에 다운로드합니다. 나는 그들을 구문 분석 할 수 있습니다

도움이 되었습니까?

해결책

당신은 찾고 있습니다 WebRequest 수업. 이 예제는 MSDN 문서에서 다음과 같습니다.

Dim request As WebRequest = WebRequest.Create("http://www.example.com/example.html")
' Get the response.
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
' Get the stream containing content returned by the server.
Dim dataStream As Stream = response.GetResponseStream()
' Open the stream using a StreamReader for easy access.
Dim reader As New StreamReader(dataStream)
' Read the content.
Dim responseFromServer As String = reader.ReadToEnd()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top