Posting data using Javascript Net.HTTP

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

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

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

Posting data using Javascript Net.HTTP

Post by marksanders » Wed Feb 06, 2019 2:00 am

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?

Ivan - Tracker Software
Site Admin
Posts: 3591
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 » Thu Feb 07, 2019 2:56 am

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 » Thu Feb 07, 2019 3:01 am

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: 6711
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Posting data using Javascript Net.HTTP

Post by Will - Tracker Supp » Wed Feb 13, 2019 8:33 am

:)
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 » Wed Mar 13, 2019 12:38 pm

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: 2273
Joined: Wed Jan 03, 2018 6:52 pm

Re: Posting data using Javascript Net.HTTP

Post by TrackerSupp-Daniel » Wed Mar 13, 2019 4:36 pm

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

Sales: +1 (250) 324-1621
Fax: +1 (250) 324-1623

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

Re: Posting data using Javascript Net.HTTP

Post by marksanders » Wed Mar 13, 2019 4:39 pm

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: 6711
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: Posting data using Javascript Net.HTTP

Post by Will - Tracker Supp » Thu Mar 14, 2019 8:26 am

: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