You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@livy.apache.org by Melchicédec NDUWAYO <nd...@gmail.com> on 2018/07/11 12:27:06 UTC
apache livy and ajax post requests: Method Not Allowed
Good morning everyone,
can someone help me to see why this jquery code can not create a session to
the apache livy? I got these errors :
*OPTIONS http://localhost:8998/ <http://localhost:8998/> 405 (Method Not
Allowed)* and *Failed to load http://localhost:8998/
<http://localhost:8998/>: Response to preflight request doesn't pass access
control check: No 'Access-Control-Allow-Origin' header is present on the
requested resource. Origin 'http://localhost:8084 <http://localhost:8084>'
is therefore not allowed access. The response had HTTP status code 405.*
Here is the jquery code to start a session:
1. var settings = {
2. "async": true,
3. "crossDomain": true,
4. "url": "http://localhost:8999/sessions",
5. "method": "POST",
6. "headers": {
7. "Content-Type": "application/json",
8. "X-Requested-By": "user",
9. "Cache-Control": "no-cache",
10. },
11. "processData": false,
12. "data": "{\"kind\": \"spark\"}"
13. }
14.
15. $.ajax(settings).done(function (response) {
16. console.log(response);
17. });
Thank you for your help
--
Cordialement
NDUWAYO Melchicédec
Université Clermont Auvergne(UCA)