Skip to content

Instantly share code, notes, and snippets.

@sany2k8
Forked from marcialsoto/ajax.js
Created July 28, 2017 16:42
Show Gist options
  • Select an option

  • Save sany2k8/0157b29b81ccd183bf44352449f9044d to your computer and use it in GitHub Desktop.

Select an option

Save sany2k8/0157b29b81ccd183bf44352449f9044d to your computer and use it in GitHub Desktop.
cors.php
$.ajax({
dataType : "text/plain",
contentType: "application/json;",
type: "post",
url: "http://172.16.8.22/AgroRuralMovil/SvcAsistencia.svc/ConsultaAsistencia",
data: {"cDni":"44069967","dFechaInicio":"2012-01-01","dFechaFin":"2017-07-04","iOpcion":1},
success: function(e){
console.log(e);
},
error: function(e){
console.log(e);
}
});
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel CORS
|--------------------------------------------------------------------------
|
| allowedOrigins, allowedHeaders and allowedMethods can be set to array('*')
| to accept any value.
|
*/
'supportsCredentials' => false,
'allowedOrigins' => ['*'],
'allowedHeaders' => ['*'],
'allowedMethods' => ['*'],
'exposedHeaders' => [],
'maxAge' => 0,
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment