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
API - POST
Moderators: Jon, Steve, Ian, Dave
-
- Moderator
- Posts: 414
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
Re: API - POST
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
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
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
Re: API - POST
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
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
0 x
Who is online
Users browsing this forum: No registered users and 9 guests