PxPlus User Forum

Twitter Twitter Twitter

Author Topic: *plus/web/request with Proxy server  (Read 270 times)

Mark Brown

  • Member
  • **
  • Posts: 5
    • View Profile
*plus/web/request with Proxy server
« on: January 27, 2023, 09:54:09 AM »
Are there any plans to enhance *plus/web/request to work with a proxy server that requires a PEM file, username and password?

It would act similar to this curl command with JSON data:
curl <destination url> --cacert <filepath of PEM file> -x https://<username>:<password>@<proxy server url> -H "Content-Type: application/json" -d "<json data>"

Mark Brown

Bruno Biancucci

  • Member
  • **
  • Posts: 9
    • View Profile
    • BrunoBiancucci.com
Re: *plus/web/request with Proxy server
« Reply #1 on: January 27, 2023, 11:45:51 AM »
I'm by no means an expert on the matter, but I do use request program all the time.  For the most part in stock form, it does a good job.  You can open this program and adjust it or a copy.  I had a case where I had to pull images from a remote site and request didn't quite work right with the expected payload, so I made a very small adjustment to the code and it's been flawless.  In another case, I wanted more details like timing and raw data being sent/received, so I added a log file; which turned out to be very help full.
I'm not sure about proxy details, but if this information needs to be included in the HTTP header, check out the "extrahdrs$" field.  I have to use this from time to time if certain credentials need to be passed to the server.
"Do or do not. There is no try." - Yoda

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3770
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: *plus/web/request with Proxy server
« Reply #2 on: January 27, 2023, 01:33:13 PM »
For Windows you can often simply replace the call to *plus/web/request with a call to *wininet. 
The calling parameters a basically the same:

   url$, postdata$, response$, header$, mimetype$, extraheaders$

It will use the Windows proxy settings.