hClient not sending Headers to Remote server

Post your Gambas programming questions here.
Post Reply
AndyGable
Posts: 363
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

hClient not sending Headers to Remote server

Post by AndyGable »

Hi Everyone,

I hope someone smart can help I though I had this fixed but when I spoke to my card processing company they told me no additional information is being sent to them in any requests

SO here what I am doing

I have declared Public HeaddersArray As New String[] in my global module and when the program start I have a Module called "Main" and inside this is a Public sub called Main and the following code is run when it starts (as this is set to be the first file to be processed when the application starts up)

Global.HeaddersArray.Add("Software-House-ID: SD45T92")
Global.HeaddersArray.Add("Installer-Id: SD45T92")


Also in my Global Module I have Public hClient As HttpClient ( the below code runs in inside the global Module), when I send a Request to the Server I am using the following code
global.buffer = Null
    hClient = New HttpClient

    With hClient
        .URL = urlRequested
        .Auth = 1
        .User = Global.PS_USER
        .Password = Global.PS_PASS
        .Async = False
        .Timeout = 60
        .Get(global.HeaddersArray)  <--- DOES nothing 

        Select Case Methold
            Case "GET"
                .Get
        
            Case "POST"
                .Post("application/connect.v2+json", jsonString)
        End Select

    End With
    
    Return hClient


What It should do is send in the header the extra 2 settings. It is logging me in to the Card Processing Server and performing all the functions it should do but I should be sending the extra data

am I doing this wrong?? I was following information I found on-line that said this was how to send the extra header information (this was the post I was following) viewtopic.php?t=1445

Any guidance, help or advise would be most welcomed.
Post Reply