title: Send JSON file in HTTP (VB6)
body: <p>I can now able to send the pure text in HTTP using this code..</p>
  
  <pre><code>Public Function WebRequest(url As String, jsonFile As String) As String
      'In this string, I am putting the parsed JSON file
      jsonFile = ReadTextFile(jsonFile)
  
      Dim http As MSXML2.XMLHTTP60
      Set http = CreateObject("MSXML2.ServerXMLHTTP")
  
      http.Open "POST", url, False
      http.send jsonFile
  
      WebRequest = http.responseText
      Set http = Nothing
  End Function
  </code></pre>
  
  <p>This function is just to parse the JSON file, I have CommonDialog control for choosing the file.</p>
  
  <pre><code>Public Function ReadTextFile(sFilePath As String) As String
     On Error Resume Next
  
     Dim handle As Integer
     If LenB(Dir$(sFilePath)) &gt; 0 Then
  
        handle = FreeFile
        Open sFilePath For Binary As #handle
        ReadTextFile = Space$(LOF(handle))
        Get #handle, , ReadTextFile
        Close #handle
     End If
  
  End Function
  </code></pre>
  
  <p>That simple code will successfully POST a text in HTTP, but what I want is to post the exact JSON file, not just the text inside of it.</p>