Skip to content

Instantly share code, notes, and snippets.

@BastinRobin
Created October 3, 2018 07:22
Show Gist options
  • Select an option

  • Save BastinRobin/b3738abeeb8a85b5dcb65ddd3285a15d to your computer and use it in GitHub Desktop.

Select an option

Save BastinRobin/b3738abeeb8a85b5dcb65ddd3285a15d to your computer and use it in GitHub Desktop.
Excel Macro HTTP
Private Sub cmdKirimGET_Click()
Dim strResult As String
Dim objHTTP As Object
Dim URL As String
Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
URL = "http://www.predicteasy.com/api/sentiment/"
objHTTP.Open "GET", URL, False
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHTTP.setRequestHeader "Content-type", "application/json"
objHTTP.send ("text=I really liked the movie and more interesting it is")
strResult = objHTTP.responseText
Worksheets("Sheet1").Range("A10:A10") = strResult
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment