Archived Forum Post

Index of archived forum posts


losing form postdata format on https post

Jan 20 '16 at 19:06

I am sending the contents of a file over to a third party, I load in the file and verify that I have carriage returns in the right place. I am able to set the form parameter, and call the page that is going to receive the data and parse on the carriagge returns. However, on the receiving form when I pull the contents out, it doesn't see the carriage returns and therefore doesnt do the parsing.

Here is my code

        Dim https As New Chilkat.Http()
        'Set the licence key for the chilkat component
        Dim success As Boolean = https.UnlockComponent("lickey")
dim domain as string = ""
            With https
                'Traverse through hl7 messages
                For Each fl In files
                    'Send over the file to the processor page on client side
                    Dim req As New Chilkat.HttpRequest
                    Dim postvalue() As String
                    req.Path = "/mytest.aspx" 'mytest only

postvalue = IO.File.ReadAllLines(fl.FullName)
                    Dim postsent As String
                    For Each s As String In postvalue
                        postsent &= s & " " & vbCr

                    postsent = postsent

                    req.AddParam("payload", postsent)
                    ''Bloody success
                    Dim resp As Chilkat.HttpResponse
                    resp = https.SynchronousRequest(domain, 80, False, req)
                    If resp Is Nothing Then
                        strErr &= vbNewLine & https.LastErrorText & " [" & fl.FullName & "]"
                        blnReturn = False
                        Exit For
                        resp = Nothing
                        req = Nothing
                        'Move files to archive folder
                        If IO.File.Exists(fl.FullName.Replace("transfer", "archive\mydata\")) Then
                            fl.MoveTo(fl.FullName.Replace("transfer", "archive\mydata\"))
                        End If
                    End If
            End With

Everything is working correctly code wise, but once the destination receives the content of the file, the carriage returns are dropped. Any help you can give on this would be appreciated. Thanks.


This was fixed...


To understand the problem better, post the contents of the LastErrorText property for the call to SynchronousRequest. It would be best if the http.VerboseLogging property is set to True beforehand.

Also, set the http.SessionLogFilename property to log the exact HTTP request and response to a file. Then post the contents of the session log.