I used to call web service with parameter like this and works fine.
-
- function InvokeRequest(Url, Param, SuccessCallback, ErrorCallback) {
- $.ajax({
- type: "POST",
- url: Url,
- cache: false,
- contentType: "application/json; charset=utf-8",
- data: Param,
- dataType: "json",
- success: SuccessCallback,
- error: ErrorCallback
- });
- }
Today I have a web service which do not need any parameter, so I invoke with Param = "" and I have tried = null too.
-
- function InvokeRequest(Url, SuccessCallback, ErrorCallback) {
- $.ajax({
- type: "POST",
- url: Url,
- cache: false,
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- success: SuccessCallback,
- error: ErrorCallback
- });
But instead of firing the success callback, it alert the result 200 ok with the JSON result.
What do I do wrong?