使用Swift发布请求不起作用

时间:2015-05-07 11:49:30

标签: swift post parameters http-post httprequest

在我的第一个问题中,我遇到了错误并且已经修复,但现在没有错误,但没有任何事情发生。 我想在这里http://blich.iscool.co.il/tabid/2117/language/he-IL/Default.aspx/显示这个表的所有组件,但是我的gui和其他东西,我只想从该表中提取信息到我的应用程序。但是,我有一个问题,我想从该表中提取正确的信息,因为如果您点击例如最简单的按钮“מערכתשינויים”,该表出现,但网址不改变所以它是POST方法,我的chrome我检查了在POST方法中调用了哪些参数,它向我展示了这个: when click the rightest button those are the POST parameters

我希望我的应用程序执行所有POST请求并打印响应,因此有助于file做帖子并获取我编写此代码:

func postR(){
    SRWebClient.POST("http://blich.iscool.co.il/tabid/2117/language/he-IL/Default.aspx/").data(["__EVENTTARGET":"dnn$ctr7919$TimeTableView$btnChangesTable","__LASTFOCUS":"","__VIEWSTATE":"/wEPDwUIMjU3MTQzOTcPZBYGZg8WAh4EVGV4dAU+PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwvL0VOIj5kAgEPZBYMAgEPFgIeB1Zpc2libGVoZAICDxYCHgdjb250ZW50BQjXkdec15nXmmQCAw8WAh8CBQjXkdec15nXmmQCBA8WAh8CBSDXm9ecINeU15bXm9eV15nXldeqINep157Xldeo15XXqmQCBQ8WBB8CZB8BaGQCBg8WAh8CBQjXkdec15nXmmQCAg9kFgJmD2QWAgIED2QWAmYPZBYOAgEPZBYCAgEPZBYIAgEPDxYCHwFoZGQCAw8PFgIfAWhkZAIFD2QWAgICDxYCHwFoZAIHD2QWAgIBD2QWAgIBD2QWCmYPEGQQFQAVABQrAwBkZAIDDxYCHwFoZAIEDxYCHwFoZAIGD2QWAmYPZBYgZg9kFgICAQ8QZBAVPQbXmCAtIDEG15ggLSAyBteYIC0gMwbXmCAtIDQG15ggLSA1BteYIC0gNgbXmCAtIDcG15ggLSA4BteYIC0gOQfXmCAtIDEwB9eYIC0gMTE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VkZAIIDxYEHwMFCkhlYWRlckNlbGwfAWhkAgkPFgIfAWhkAgoPFgIfAwUKSGVhZGVyQ2VsbGQCDA8WAh8DBQpIZWFkZXJDZWxsZAIODxYCHwMFCkhlYWRlckNlbGxkAhAPFgQfAwUKSGVhZGVyQ2VsbB8BaGQCEQ8WAh8BaGQCEg8WBB8DBQpIZWFkZXJDZWxsHwFoZAITDxYCHwFoZAIUDxYEHwMFCkhlYWRlckNlbGwfAWhkAggPDxYCHwAFOtee16LXldeT15vXnyDXnDogMDYuMDUuMjAxNSwg16nXoteUOiAyMjo0OSwg157XodeaOiBBMzc5MTlkZAIDDxYCHwMFGXRvcHJpZ2h0cGFuZSBETk5FbXB0eVBhbmVkAgUPFgIfAwUYdG9wbGVmdHBhbmUgRE5ORW1wdHlQYW5lZAIHDxYCHwMFFnJpZ2h0cGFuZSBETk5FbXB0eVBhbmVkAgkPFgIfAwUYY29udGVudHBhbmUgRE5ORW1wdHlQYW5lZAILDxYCHwMFFWxlZnRwYW5lIEROTkVtcHR5UGFuZWQCDQ8WAh8DBRdib3R0b21wYW5lIEROTkVtcHR5UGFuZWRk27oj0maYUABIV9oq6gpKrXwfOiI=","__VIEWSTATEGENERATOR":"CA0B0334","dnn$ctr7919$TimeTableView$ClassesList":"5","dnn$ctr7919$TimeTableView$MainControl$WeekShift":"0","dnn$ctr7919$TimeTableView$ControlId":"8"]).send({(response:AnyObject!, status:Int) -> Void in
            //this is success part
            println(response)
            }, failure:{(error:NSError!) -> Void in
                //this is failure part
                println(error)
        })
}

更好地查看代码: enter image description here

但是输出(响应)是错误的,与chrome获得的输出不同,我想要获得chrome获得的内容,感谢!!!

0 个答案:

没有答案