PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Posting a File to a Web Service  (Read 18 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 179
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Posting a File to a Web Service
« on: May 17, 2024, 09:47:02 PM »
Hi List,
in the past i could never get *plus/web/request work with uploading a file.
i can get it to work in postman, curl and powershell....but i cannot get syntax right in pxplus
i'm referring to line 100 .
does anyone know what i'm doing wrong or has used *plus/web/request to post/upload file
i dont want to use a 3rd party utility if i can help it

0040 let RAW_CREDENTIALS$="username:password"
0050 call "*web/base64;ENCODE_STR",RAW_CREDENTIALS$,BASE64_CREDENTIALS$
0060 let EXTRA_HEADERS$="Authorization: Basic "+BASE64_CREDENTIALS$
0070 let MIME_TYPE$="multipart/form-data"
0080 let URI$="https://staging.saberis.com:9000/api/v1/documents/modules/21/upload"
0100 let BODY$="filename=Cleary_Quote.xml"
0110 call "*plus/web/request",URI$,BODY$,RESPONSE$,RESPONSE_HEADER$,MIME_TYPE$,"",EXTRA_HEADERS$


thanks

jeff