HTTPSecureSocket Issue With Repeated Header

So i can do this request in Postman and it works correctly but recreating it with XOJO causes it to fail.
I’m thinking it has something to do with the redundant cookie headers i need for the call to work.

POSTMAN CURL:

GET /v4_6_release/apis/3.0/service/tickets?pageSize=1 HTTP/1.1 Host: <<redacted>> Cookie: companyName=<<redacted>> Cookie: memberHash=<<redacted>> Cookie: memberId=brocknash

IN XOJO:

dim url as string = <<redacted>> dim h as new HTTPSecureSocket h.Secure = true h.requestHeaders.AppendHeader("Cookie","companyName="+companyid) h.requestHeaders.AppendHeader("Cookie","memberHash="+MemberHash) h.requestHeaders.AppendHeader("Cookie","memberID="+Memberid) dim result as string = h.Get(url, 10)

I’ve quadruple checked that all the tokens are the same in both requests. The only thing that stands out to me as abnormal is that in XOJO it adds the headers as “Cookie”,“Cookie:1”,“Cookie:2”

Anyone else have any ideas how to work around this?

Could it be an HTTP 1.1 vs 1.0 issue? Have you tried Xojo.Net.HTTPSocket (which uses HTTP 1.1 instead of HTTP 1.0 used by HTTPSecureSocket)?

I don’t know much about this, but maybe this will help: http://documentation.xojo.com/index.php/HTTPSocket

[quote]To send one or more cookies with an HTTP request:

socket.SetRequestHeader("Cookie", Join(Array(cookie1, cookie2), "; "))

Maybe you need to change your code from:

h.requestHeaders.AppendHeader("Cookie","companyName="+companyid) h.requestHeaders.AppendHeader("Cookie","memberHash="+MemberHash) h.requestHeaders.AppendHeader("Cookie","memberID="+Memberid)
to

  h.requestHeaders.AppendHeader("Cookie","companyName="+companyid+"; "+"memberHash="+MemberHash+"; "+"memberID="+Memberid)

Just an idea, it may not fix your problem.

Thanks @[Alberto De Poo] that was it! I just needed to combine them into a single header!