Calling JSON web service with parameters - Objective C - iOS

后端 未结 3 1411
暗喜
暗喜 2021-02-08 20:31

I\'m trying to call a simple JSON webservice with a parameter in objective c. Doesn\'t work so far.

Here is the web service method:

[WebMethod]
[ScriptMe         


        
3条回答
  •  别那么骄傲
    2021-02-08 21:29

    I had a similar problem. I was setting the HTML body with jsonData as you do and it didn't work. It turned out that the JSON service wasn't configured as it was supposed to be.

    So, instead of setting the HTML body, try calling the URL like a GET method.

    I mean, remove the lines that you set the HTML body, and change the URL to

    http://localhost:8080/ListrWS.asmx/LogIn?username=usernameTest&password=passwordTest
    

    Don't change the method (POST).

    If this works, you will have to do some work on the server side.

提交回复
热议问题