• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

AJAX call fails with SyntaxError: Unexpected end of JSON input

javascriptphpjqueryajax


PHP Snippet 1:

var data = {};
 data['rawFiles'] =$('#projectIDs').val(); 
 data['metadata'] = $('#getData').val();
  data['type']=  $('#submitType').val();
  data['pid']='csv';
   data['command']='data/qcTest'

PHP Snippet 2:

$.ajax({type: "POST", url: posturl, data: JSON.stringify(data), dataType: 'json'})

Related Snippets

How to Display Data in Yajra Datatables Laravel 7?

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

Change the alert text on add to cart action without selected variation in Woocommerce

Laravel Multi-language routes without prefix

Laravel update hasMany relationship using saveMany

XSS attack still works despite htmlspecialchars() doing its work

xdebug 3 not working in ubuntu 20.04 with docker

generate an Excel file using PHP

MongoDB Duplicate Documents even after adding unique key

PHP's array_map including keys

Elasticsearch - Want to sort by field in all indices where that particular field available or not if not then avoid it

Laravel csrf token mismatch for ajax POST Request

wp_remote_get() not passing authentication

php mysql + create a friend request system

About Contact Privacy policy Terms and conditions