Passing data to objective c with POST rather than GET

前端 未结 3 1641
情书的邮戳
情书的邮戳 2020-12-29 16:54

I have been using the url intercept method to pass data from javascript to objective C by passing the data as url encoded parameters and using NSURLProtocol to intercept the

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-29 17:47

    Any request will be intercepted by the delegate so you can send any POST Ajax request, stuff it with the parameters and values that you want and then send it. All the values will be intercepted and you can use them the same way you are doing so far. An easy POST request could be sent using JQuery, as easy as:

    $.post("toobjc.html", { 'data':"10k characters long string and more here ..." });

    More here: http://api.jquery.com/jQuery.post/

提交回复
热议问题