• 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 can I make Laravel return a custom error for a JSON REST API

enable Apache http Authorization header

Input and output values for php into the browser?

How to display table header in every page using FPDF library?

Phpunit partial mock + proxy Entity

wordpress function breaks wp-admin

Limit of log line written to Apache Errorlog from mod php error_log

Lexik JWT authentication problem "Invalid credentials"

Laravel csrf token mismatch for ajax POST Request

CodeIgniter 4: Like and Dislike Functionality

Php - Sum up the numbers in an array one by one

How to get AJAX to post on second page?

How to test laravel controller method?

carbon generated datetime not stored correctly into the database

Call authenticate manually in router middleware

About Contact Privacy policy Terms and conditions