Page 1 of 1

Posting data using Javascript Net.HTTP

Posted: Wed Feb 06, 2019 2:00 am
by marksanders
I'm using Javascript in PDF-XChange Editor to post information to a web service where it is read using php. It's all working great except I can't work out how to successfully post my data in the body of the post, using the oRequest parameter, and read it using php on the server. The only thing I could get to work is posting in the header using a redundant header field (I picked PRAGMA). This is obviously far from ideal.

This is my Javascript triggering the post (I want to use oRequest but instead have to use aHeaders):

postData = app.trustedFunction(function(f) {
app.beginPriv();
var urlStr = "http://mywebsite.com/postdata.php"
Net.HTTP.request({
cVerb: "POST",
cURL: urlStr,
// oRequest: util.streamFromString(JSONstr),
aHeaders:[{ name: "PRAGMA", value: syncs[f].JSONstr }],
oHandler: ajaxCallback
});
app.endPriv();
});


This is my php on the server (I want to use the first line, but have to use the second):

// $dataPOST = file_get_contents('php://input');
$dataPOST = $_SERVER['HTTP_PRAGMA'];


Is there something I'm doing wrong here?

Re: Posting data using Javascript Net.HTTP

Posted: Thu Feb 07, 2019 2:56 am
by Ivan - Tracker Software
There was an issue with handling oRequest parameter in Editor's code.
We have fixed this issue and the fix will be available in the next build.

Re: Posting data using Javascript Net.HTTP

Posted: Thu Feb 07, 2019 3:01 am
by marksanders
Hi Ivan,

That's great! Thanks for the help. I'll download the next build when it's available.

Mark

Re: Posting data using Javascript Net.HTTP

Posted: Wed Feb 13, 2019 8:33 am
by Will - Tracker Supp
:)

Re: Posting data using Javascript Net.HTTP

Posted: Wed Mar 13, 2019 12:38 pm
by marksanders
Hi,

My company is looking to buy the corporate global pack of PDF-XChange Editor Plus, but having this fix implemented is necessary prior to making the purchase. When do you expect the new build with the fix will be released?

Thanks

Re: Posting data using Javascript Net.HTTP

Posted: Wed Mar 13, 2019 4:36 pm
by TrackerSupp-Daniel
Hello Marksanders,

We are hoping to release the next build close to the end of this month, give or take a few days for fine tuning. I hope that is not too long of a wait for you.

Kind regards,

Re: Posting data using Javascript Net.HTTP

Posted: Wed Mar 13, 2019 4:39 pm
by marksanders
Hi Daniel,

No, that's great. I'll come back and check for it then.

Thanks,
Mark

Re: Posting data using Javascript Net.HTTP

Posted: Thu Mar 14, 2019 8:26 am
by Will - Tracker Supp
:D