Hi guys
I'm investigating how to streaming reports/PDF's from OpenEdge to a REST-service. That REST-service requires me to do streaming, but I can't find any support from streaming with the current HTTP implementation.
I'm wondering if anyone has done this before or if someone can give me some usefull pointers?
Hi,
I can't use System.NET because our backend also runs on Linux/Unix.
And making calls from the client, by using System.NET, is not desireable because of the tight security measures that are in place nowadays.
But... it turned out that the REST-service that I needed to call, is accepting the request from openedge. I used a Multipart message that contained one binary part, and it worked like a charm!!
So thanks for your time everyone!
Hi Peter,
This javascript example show how we would send data to it from postman for example. I'm wondering if i could mimic the same approach in OpenEdge?
Regards, Onno
var http = require("http");
var options = {
"method": "POST",
"hostname": [
"test",
"test
],
"path": [
"api",
"v1",
"attachments"
],
"headers": {
"content-type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
"Cache-Control": "no-cache",
"Postman-Token": "8631da63-55e3-43f0-bdb4-1fee2cfca911"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"attachment\"\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"attachment\"\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
req.end();
[quote user="onnodehaan"]
Hi guys
I'm investigating how to streaming reports/PDF's from OpenEdge to a REST-service. That REST-service requires me to do streaming, but I can't find any support from streaming with the current HTTP implementation.
I'm wondering if anyone has done this before or if someone can give me some usefull pointers?
[/quote]
Have you looked at System.Net.HttpWebRequest with the SendChunked set to true?
Hi,
I can't use System.NET because our backend also runs on Linux/Unix.
And making calls from the client, by using System.NET, is not desireable because of the tight security measures that are in place nowadays.
But... it turned out that the REST-service that I needed to call, is accepting the request from openedge. I used a Multipart message that contained one binary part, and it worked like a charm!!
So thanks for your time everyone!