Answer the question
In order to leave comments, you need to log in
POST request to send data to the server?
how to make a POST request to javascipt that takes data (in this case, the c# language code), sends it to the site, where this code is compiled and returns the result?
there is code that does the same but for c++ language:
var cmd = "g++ -Wall main.cpp -o main_prog && echo 'Compilation: SUCCESS."
+ " Program output is:\n' && ./main_prog && echo "\nExit code: $?"";
var output = $("#output");
output.text('');
var to_compile = {
"src": code.getValue(),
"cmd": cmd,
};
output.text("Executing... Please wait.");
$.ajax({
url: "coliru.stacked-crooked.com/compile",
type: "POST",
dataType: "text"
}).done(function(data) {
output.text(data);
}).fail(function(data) {
output.text("Server error: " + data);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question