97
Views
9
Comments
Solved
How can I recieve a pdf from an HTTP POST query to my API and save It ?
Question

I'm trying to recieve a file from a HTTP POST query that is recieved for an API rest and save it. But I don't know how.

2021-06-09 13-39-18
Agno Silveira
 
MVP
Solution

Hi Bruno,

A possible solution is to use the PDF file binary to receive or send by REST.

You can also save the binary in the database, example:

Regards.

2020-11-24 03-50-17
Bruno Aguilar

Ango,

      Hello! I hope you are doing well. It was very usefull!! thanks!!

Good bye.

2021-06-09 13-39-18
Agno Silveira
 
MVP

I'm glad I could help.

2020-11-24 03-50-17
Bruno Aguilar

Agno,

   I did something very similar, but now I'm having troubles testing It, I used to do it with postman, but I dont know how to send a binary pdf in the JSON. Do you know how to do it?

Thanks!!

2021-06-09 13-39-18
Agno Silveira
 
MVP

Hello Bruno,

are you trying to send the binary(PDF) by the postman to Outsystems endpoint?

2020-11-24 03-50-17
Bruno Aguilar

Agno,

    Yes! That's what I'm trying to do!!

2021-06-09 13-39-18
Agno Silveira
 
MVP

Right,

Steps:


1 - Create an End point REST in Service Studio:


2 - open documentation to get the URL, to use in POSTMAN:


3 - Convert your PDF to binary in some site, example https://base64.guru/converter/encode/pdf


4 - Send by Postman:


I created and application example, see in attachment.


Regards.

ReceivePDF.oml
2021-06-09 13-39-18
Agno Silveira
 
MVP

Bruno,

Look this test after send by postman and save binary in database:

Hope this helps.

2020-11-24 03-50-17
Bruno Aguilar

Agno,

   Again, It works really well!! Thank you so much, I Just copy the binary or base64 text in to postman and it works!! 

Good bye!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.