PxPlus User Forum

Twitter Twitter Twitter

Author Topic: accept-encoding gzip issue with call "*plus/web/request"  (Read 88 times)

Cedric

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
accept-encoding gzip issue with call "*plus/web/request"
« on: May 09, 2024, 04:30:25 PM »
Hi, I would like to report 1 issue that I have juste encountered:

Unable to read compressed data like gzip for example.  Normally, I would specify in the header "accept-encoding: none" and it would result in a non compressed response, but on this particular server, it seems they force the response in gzip no matter what I do.  So, now I have to figure out how to handle this in PVX!
« Last Edit: May 09, 2024, 04:47:34 PM by Cedric »

Mike King

  • Diamond Member
  • *****
  • Posts: 3824
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: accept-encoding gzip issue with call "*plus/web/request"
« Reply #1 on: May 10, 2024, 12:21:30 AM »
If you need to provide the content type to the request you can pass it in as the fifth parameter to *plis/web/request.

See https://manual.pvxplus.com/PXPLUS/Web%20Services/Overview.htm#submitting

To compress data use the CMP() function and strip the first byte as per the manual.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Mike King

  • Diamond Member
  • *****
  • Posts: 3824
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: accept-encoding gzip issue with call "*plus/web/request"
« Reply #2 on: May 10, 2024, 08:26:37 AM »
Further info...

If you need to decompress data in a response prefix the data with a $00$ then pass it to the UCP function.

See https://manual.pvxplus.com/PXPLUS/functions/ucp.htm for details
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Cedric

  • Silver Member
  • ***
  • Posts: 27
    • View Profile
Re: accept-encoding gzip issue with call "*plus/web/request"
« Reply #3 on: May 10, 2024, 11:04:26 AM »
Thanks Mike, the info is helpful, but unfortunately the UCP solution throws an error 46.
I've tried with prefix, without, with other like $01$, $02$, etc... Always the same...

I'm thinking it may be related to the error 29 I'm getting while trying to simply print the data to screen.


Anyway, for now, I was able to reach out to the server admin so that I can receive the data uncompressed.


thanks

Mike King

  • Diamond Member
  • *****
  • Posts: 3824
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: accept-encoding gzip issue with call "*plus/web/request"
« Reply #4 on: May 10, 2024, 04:25:24 PM »
Glad to hear you got it to work.

Perhaps the data is nt only gzip'ed but also Base64 encoded which would be common where binary data, such as what would be in the zipped contents, is involved.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com