Dim sb As StringBuilder
sb.Initialize
sb.Append("POST /hapld/tos/kdwhapltos HTTP/1.1" & CRLF)
sb.Append("Content-type: multipart/mixed; boundary=BOUNDARY" & CRLF)
sb.Append("Host: www.pld-certify.ups.com" & CRLF)
sb.Append("Content-length: "&(sb.Length+21)& CRLF)
sb.Append("--BOUNDARY" & CRLF)
sb.Append("Content-type: application/x-www-form-urlencoded" & CRLF)
sb.Append("Content-length: "&78&CRLF)
sb.Append(CRLF)
sb.Append("AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=" & data(4) & "&Password=" & data(5) & CRLF)
sb.Append(CRLF)
sb.Append("--BOUNDARY" & CRLF)
sb.Append("Content-type: application/x-ups-binary" & CRLF)
sb.Append("Content-length: " & File.Size(path,filename) & CRLF)
sb.Append(CRLF)
sb.Append(ff)
sb.Append(CRLF)
sb.Append("--BOUNDARY--" & CRLF)
If File.Exists(File.DirTemp,"ups") Then
File.Delete(File.DirTemp,"ups")
End If
File.WriteString(File.DirTemp,"ups",sb.ToString)
Try
okHTTP.InitializeAcceptAll("HTTPSOK")
Dim res As OkHttpRequest
res.InitializePost(data(3),File.OpenInput(File.DirTemp,"ups"),File.OpenInput(File.DirTemp,"ups").BytesAvailable)
res.SetContentType("Content-type: multipart/mixed; boundary=BOUNDARY")
okHTTP.Execute(res,0)
Catch
ListView2.Items.Add(Chr(0xF071)&" Errore nell'invio del file !")
If controller <> "" Then
' ControlMail(action,controller,Chr(0xF071)&BytesToString(out.ToBytesArray, 0, out.ToBytesArray.Length, "utf8"))
End If
Log(LastException.Message)
End Try