forum

Home / DeveloperSection / Forums / using Get for ajax calls gives me 500 error

using Get for ajax calls gives me 500 error

Anonymous User 1699 02-Sep-2014

I was calling a [web method] using POST but as I am 'getting' data back I am trying to use GET instead.

Using Post works. Using GET gives me a 500 error.

This is the main jquery call to my [web method]:

        $.ajax({
            type: 'GET',
            contentType: 'application/json',
            dataType: 'json',
            url: 'Cloud/Feed.aspx/GetNextFrames2',
            data: '{ test: "hime"}',
~

This is my test [web method].

[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public static string GetNextFrames2(string test)
{
    return 'test'
}

If I do not pass any parameters I will get no error using GET. As soon as add a parameter I get 500 internal error.

I have used wireshark and Fiddler but I cannot see anything useful.

This is obviously down to using parameters. So, at least I have pinpointed where the error is.

I have tried passing the parameters directly appended to the url:

myurl?par=testme...

but still same error.

What else can I try?


Updated on 03-Sep-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By