Posting data using Javascript Net.HTTP

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
marksanders
User
Posts: 6
Joined: Wed Feb 06, 2019 1:44 am

Posting data using Javascript Net.HTTP

Post 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?
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Posting data using Javascript Net.HTTP

Post 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.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
marksanders
User
Posts: 6
Joined: Wed Feb 06, 2019 1:44 am

Re: Posting data using Javascript Net.HTTP

Post by marksanders »

Hi Ivan,

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

Mark
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Posting data using Javascript Net.HTTP

Post by Will - Tracker Supp »

:)
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
marksanders
User
Posts: 6
Joined: Wed Feb 06, 2019 1:44 am

Re: Posting data using Javascript Net.HTTP

Post 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
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8436
Joined: Wed Jan 03, 2018 6:52 pm

Re: Posting data using Javascript Net.HTTP

Post 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,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
marksanders
User
Posts: 6
Joined: Wed Feb 06, 2019 1:44 am

Re: Posting data using Javascript Net.HTTP

Post by marksanders »

Hi Daniel,

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

Thanks,
Mark
User avatar
Will - Tracker Supp
Site Admin
Posts: 6815
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Posting data using Javascript Net.HTTP

Post by Will - Tracker Supp »

:D
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com
Post Reply