What is the equivalent of curl request in JavaScript?how to get files from <input type='file' …/> (Indirect) with javascriptHow do JavaScript closures work?What is the most efficient way to deep clone an object in JavaScript?Which equals operator (== vs ===) should be used in JavaScript comparisons?What is the !! (not not) operator in JavaScript?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?Is it possible to apply CSS to half of a character?
Based on what criteria do you add/not add icons to labels within a toolbar?
Is DC heating faster than AC heating?
Best way to explain to my boss that I cannot attend a team summit because it is on Rosh Hashana or any other Jewish Holiday
Can external light meter replace the need for push/pull?
Does bottle color affect mold growth?
Why do private jets such as Gulfstream fly higher than other civilian jets?
Should I self-publish my novella on Amazon or try my luck getting publishers?
"How do you solve a problem like Maria?"
What is the bio-mechanical plausibility of a fox with venomous fangs?
Will a paper be retracted if a flaw in released software code invalidates its central idea?
What are the examples (applications) of the MIPs in which the objective function has nonzero coefficients for only continuous variables?
Are children a reason to be rejected for a job?
How to draw a flow chart?
Decode a variable-length quantity
How to check a file was encrypted (really & correctly)
How can glass marbles naturally occur in a desert?
ESTA declined to the US
What city skyline is this picture of?
How to realistically deal with a shield user?
How to help new students accept function notation
Is there such thing as a "3-dimensional surface?"
How to halve redstone signal strength?
Did WWII Japanese soldiers engage in cannibalism of their enemies?
What is a Casino Word™?
What is the equivalent of curl request in JavaScript?
how to get files from <input type='file' …/> (Indirect) with javascriptHow do JavaScript closures work?What is the most efficient way to deep clone an object in JavaScript?Which equals operator (== vs ===) should be used in JavaScript comparisons?What is the !! (not not) operator in JavaScript?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?Is it possible to apply CSS to half of a character?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
The website CERMINE has provided REST service with cURL tools. They give the following example:
curl -X POST --data-binary @article.pdf
--header "Content-Type: application/binary"
http://cermine.ceon.pl/extract.do
How can I convert the following into JavaScript?
Edit #1:
So the fetch would look like this?
fetch("http://cermine.ceon.pl/extract.do",
body: "@article.pdf",
headers:
"Content-Type": "application/binary\"
,
method: "POST"
)
javascript curl
|
show 6 more comments
The website CERMINE has provided REST service with cURL tools. They give the following example:
curl -X POST --data-binary @article.pdf
--header "Content-Type: application/binary"
http://cermine.ceon.pl/extract.do
How can I convert the following into JavaScript?
Edit #1:
So the fetch would look like this?
fetch("http://cermine.ceon.pl/extract.do",
body: "@article.pdf",
headers:
"Content-Type": "application/binary\"
,
method: "POST"
)
javascript curl
developer.mozilla.org/en-US/docs/Web/API/Fetch_API (newer, promised based) or developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest (older, callback based)
– Phil
Mar 27 at 5:22
Keep in mind, if you run this in a browser, you are subject to the same origin policy. See developer.mozilla.org/en-US/docs/Web/HTTP/CORS
– Phil
Mar 27 at 5:22
Looks like that site supports CORS response headers so you're in luck
– Phil
Mar 27 at 5:24
How are you planning on getting thearticle.pdf
file to your script? Is this to run in a browser or via Node?
– Phil
Mar 27 at 5:28
@Phil The article.pdf will be on the browser.
– Saman Ray
Mar 27 at 5:29
|
show 6 more comments
The website CERMINE has provided REST service with cURL tools. They give the following example:
curl -X POST --data-binary @article.pdf
--header "Content-Type: application/binary"
http://cermine.ceon.pl/extract.do
How can I convert the following into JavaScript?
Edit #1:
So the fetch would look like this?
fetch("http://cermine.ceon.pl/extract.do",
body: "@article.pdf",
headers:
"Content-Type": "application/binary\"
,
method: "POST"
)
javascript curl
The website CERMINE has provided REST service with cURL tools. They give the following example:
curl -X POST --data-binary @article.pdf
--header "Content-Type: application/binary"
http://cermine.ceon.pl/extract.do
How can I convert the following into JavaScript?
Edit #1:
So the fetch would look like this?
fetch("http://cermine.ceon.pl/extract.do",
body: "@article.pdf",
headers:
"Content-Type": "application/binary\"
,
method: "POST"
)
javascript curl
javascript curl
edited Mar 27 at 5:33
Phil
104k13 gold badges156 silver badges176 bronze badges
104k13 gold badges156 silver badges176 bronze badges
asked Mar 27 at 5:20
Saman RaySaman Ray
551 silver badge9 bronze badges
551 silver badge9 bronze badges
developer.mozilla.org/en-US/docs/Web/API/Fetch_API (newer, promised based) or developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest (older, callback based)
– Phil
Mar 27 at 5:22
Keep in mind, if you run this in a browser, you are subject to the same origin policy. See developer.mozilla.org/en-US/docs/Web/HTTP/CORS
– Phil
Mar 27 at 5:22
Looks like that site supports CORS response headers so you're in luck
– Phil
Mar 27 at 5:24
How are you planning on getting thearticle.pdf
file to your script? Is this to run in a browser or via Node?
– Phil
Mar 27 at 5:28
@Phil The article.pdf will be on the browser.
– Saman Ray
Mar 27 at 5:29
|
show 6 more comments
developer.mozilla.org/en-US/docs/Web/API/Fetch_API (newer, promised based) or developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest (older, callback based)
– Phil
Mar 27 at 5:22
Keep in mind, if you run this in a browser, you are subject to the same origin policy. See developer.mozilla.org/en-US/docs/Web/HTTP/CORS
– Phil
Mar 27 at 5:22
Looks like that site supports CORS response headers so you're in luck
– Phil
Mar 27 at 5:24
How are you planning on getting thearticle.pdf
file to your script? Is this to run in a browser or via Node?
– Phil
Mar 27 at 5:28
@Phil The article.pdf will be on the browser.
– Saman Ray
Mar 27 at 5:29
developer.mozilla.org/en-US/docs/Web/API/Fetch_API (newer, promised based) or developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest (older, callback based)
– Phil
Mar 27 at 5:22
developer.mozilla.org/en-US/docs/Web/API/Fetch_API (newer, promised based) or developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest (older, callback based)
– Phil
Mar 27 at 5:22
Keep in mind, if you run this in a browser, you are subject to the same origin policy. See developer.mozilla.org/en-US/docs/Web/HTTP/CORS
– Phil
Mar 27 at 5:22
Keep in mind, if you run this in a browser, you are subject to the same origin policy. See developer.mozilla.org/en-US/docs/Web/HTTP/CORS
– Phil
Mar 27 at 5:22
Looks like that site supports CORS response headers so you're in luck
– Phil
Mar 27 at 5:24
Looks like that site supports CORS response headers so you're in luck
– Phil
Mar 27 at 5:24
How are you planning on getting the
article.pdf
file to your script? Is this to run in a browser or via Node?– Phil
Mar 27 at 5:28
How are you planning on getting the
article.pdf
file to your script? Is this to run in a browser or via Node?– Phil
Mar 27 at 5:28
@Phil The article.pdf will be on the browser.
– Saman Ray
Mar 27 at 5:29
@Phil The article.pdf will be on the browser.
– Saman Ray
Mar 27 at 5:29
|
show 6 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370271%2fwhat-is-the-equivalent-of-curl-request-in-javascript%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55370271%2fwhat-is-the-equivalent-of-curl-request-in-javascript%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
developer.mozilla.org/en-US/docs/Web/API/Fetch_API (newer, promised based) or developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest (older, callback based)
– Phil
Mar 27 at 5:22
Keep in mind, if you run this in a browser, you are subject to the same origin policy. See developer.mozilla.org/en-US/docs/Web/HTTP/CORS
– Phil
Mar 27 at 5:22
Looks like that site supports CORS response headers so you're in luck
– Phil
Mar 27 at 5:24
How are you planning on getting the
article.pdf
file to your script? Is this to run in a browser or via Node?– Phil
Mar 27 at 5:28
@Phil The article.pdf will be on the browser.
– Saman Ray
Mar 27 at 5:29