I Ian Garton Member Licensed User Longtime User Aug 12, 2014 #1 Is there a way we can read the response headers when using the HttpUtils2 library? I'm still having to use the class/service and the HttpUtils2Service.ResponseHeaders map.
Is there a way we can read the response headers when using the HttpUtils2 library? I'm still having to use the class/service and the HttpUtils2Service.ResponseHeaders map.
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2014 #2 Change hc_ResponseSuccess to: Code: Copy Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int) Response.GetAsynchronously("response", File.OpenOutput(TempFolder, TaskId, False), _ True, TaskId) Dim job As HttpJob = TaskIdToJob.Get(TaskId) job.Tag = Response.GetHeaders End Sub Now you will be able to get the headers in JobDone with this code: Code: Copy Dim headers As Map = job.Tag Upvote 0
Change hc_ResponseSuccess to: Code: Copy Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int) Response.GetAsynchronously("response", File.OpenOutput(TempFolder, TaskId, False), _ True, TaskId) Dim job As HttpJob = TaskIdToJob.Get(TaskId) job.Tag = Response.GetHeaders End Sub Now you will be able to get the headers in JobDone with this code: Code: Copy Dim headers As Map = job.Tag
L lorebarita Member Licensed User Longtime User Aug 12, 2014 #3 Hi Erel. I have been looking for such a solution but I get the following error Parsing code. 0.64 Compiling code. Error Error compiling program. Error description: Unknown member: tag Occurred on line: 49 job.Tag = Response.GetHeaders Word: tag I have spent soo much time finding a solution but I need your help Upvote 0
Hi Erel. I have been looking for such a solution but I get the following error Parsing code. 0.64 Compiling code. Error Error compiling program. Error description: Unknown member: tag Occurred on line: 49 job.Tag = Response.GetHeaders Word: tag I have spent soo much time finding a solution but I need your help
L lorebarita Member Licensed User Longtime User Aug 12, 2014 #4 Sorry I got it I just added public Tag as Object in httpjob Upvote 0
I Ian Garton Member Licensed User Longtime User Aug 13, 2014 #5 Thanks Erel, this is what I'm doing using the class module and service. I was just wondering if there was a way of getting the headers using the library instead. Upvote 0
Thanks Erel, this is what I'm doing using the class module and service. I was just wondering if there was a way of getting the headers using the library instead.
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2014 #6 No. However you can easily compile your own version of HttpUtils2 if you like. Upvote 0