API - POST

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

API - POST

#1

Postby Steve James » Wed Jan 31, 2018 9:45 am

Hi, I've written an API to write a file on the server (csv/txt/json). The API allows POST and the body is the content of the file.
Method in the madness as our Ebase 'internal' environment needs to create this type of file and save it to our 'external' Ebase DMZ server (ie the DMZ server cannot have access to the source).

The content is written but \r\n are saved in the new file as \r\n rather than the new line. Also the whole body is wrapped in quots.

I've tried setting content-type to text/plain and application/text without success. What do I need to do to write a sensible file (other than a hacky replace certain characters in the API)?

Thanks
0 x

Steve
Moderator
Moderator
Posts: 414
Joined: Fri Sep 07, 2007 3:44 pm
Location: Sandy, UK
Contact:

Re: API - POST

#2

Postby Steve » Wed Jan 31, 2018 10:36 am

Hi Steve,

Have you got an example of the API and content you are writing?

Send to support@ebasetech.com, I will take a look for you.

Steve
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

Re: API - POST

#3

Postby Steve James » Wed Jan 31, 2018 11:43 am

Thanks Steve. I worked out it wasn't a problem with the API as it ran fine when called in Postman.

I'm now investigating how I call it in the source Ebase system. I can't use standard "REST Web Service resources" as I need to go via a proxy.
I think my problem is writing the output stream, write, flush.

Thanks but challenge on :wink:
0 x


Who is online

Users browsing this forum: No registered users and 15 guests