« first day (2840 days earlier)      last day (1277 days later) » 

10:02
1 message moved from JavaScript
    var url = "ProductBatch/ProcessBatchBarcodeString";

    var jstring = JSON.stringify(barcodeText);

    $.ajax({
        type: "POST",
        url: url,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: jstring,
        success: function (data) {
            if (data) {
                alert('test');
            }
            else {
                alert('test2');
            }
        },
        error: function (xhr, textStatus, errorThrown) {
1 message moved from JavaScript
10:27
:50841497

This how it looks on the server, 3 different return

 return fetch("https://accounts.google.com/o/oauth2/token", {
    "method": "post",
    "headers": {
    "Content-Type": 'application/x-www-form-urlencoded'
    },
    'body': data
    })
    .then((httpResponse) => {
    if (httpResponse.ok) {
    return httpResponse.json();
    } else {

     return Promise.reject("Fetch did not succeed");
    }
    })
    .then((json) => {

      console.log(json,'json.access_token backend')
      return json})
1 message moved from JavaScript
 
7 hours later…
 
3 hours later…
 
2 hours later…
21:34
:50844373
This function run from the client
GetJSON(NewURLCode).then(httpResponse => {console.log(httpResponse.access_token,httpResponse.id_token,httpResponse.refresh_token , 'get token')

And this running from the server

return fetch("https://accounts.google.com/o/oauth2/token", {
"method": "post",
"headers": {
"Content-Type": 'application/x-www-form-urlencoded'
},
'body': data
})
.then((httpResponse) => {
if (httpResponse.ok) {
return httpResponse.json();
} else {

return Promise.reject("Fetch did not succeed");
1 message moved from JavaScript

« first day (2840 days earlier)      last day (1277 days later) »