码迷,mamicode.com
首页 > 其他好文 > 详细

Fiddler Post Debug

时间:2014-05-21 20:54:49      阅读:346      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   c   code   java   

1. Post: http://localhost:11804/My/Comment   

 for plain html parameter submission, like the GET in URL:

Request Header:

User-Agent: Fiddler

 Content-Length: 33  

Host: localhost:11804  

Content-Type: application/x-www-form-urlencoded

Request Body:

url=go&url2=2&lese=sss

 

bubuko.com,布布扣
 public class MyController : Controller
{
       public class CommentInputModel
        {
            public string Url { get; set; }
            public string Url2 { get; set; }
          
        }
[HttpPost]
public ActionResult Comment(CommentInputModel model,string lese) { return null; } }
bubuko.com,布布扣

 

2.Post:http://localhost:11804/Account/Login   have  [ValidateAntiForgeryToken]

Request Header:

Content-Type: application/x-www-form-urlencoded
Cookie: __RequestVerificationToken=WAmjMYW6VXwFk21CU8zjfViWgKvW3703lBNcm7rij0cl2-Axh4_jiYkaZ_HcAmTMdca721sicaa2lAZmvYRe4IkS7shSydVTsRn7pB5EmCI1
Host: localhost:11804
Content-Length: 183

Request Body

__RequestVerificationToken=jqeqLyivYdNPWjlbLMAUf747vM1wdLcx5Xju5vbkv5S4k4kpin_z2KqbVMu07Vg2mOVLOt7ijhvOM4ranmZ73SpZwNxWfKlyOORSp8SDS7U1&UserName=admin&Password=111111&RememberMe=false

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    [HttpPost]
    [AllowAnonymous]
    [ValidateAntiForgeryToken]
   // [OutputCache(NoStore = true, Duration = 0)] 
    public ActionResult Login(LoginModel model, string returnUrl)
    {
        if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe))
        {
            return RedirectToLocal(returnUrl);
        }
 
        // If we got this far, something failed, redisplay form
        ModelState.AddModelError("", "The user name or password provided is incorrect.");
        return View(model);
    }
 
 
public class LoginModel
{
    [Required]
    [Display(Name = "User name")]
    public string UserName { get; set; }
 
    [Required]
    [DataType(DataType.Password)]
    [Display(Name = "Password")]
    public string Password { get; set; }
 
    [Display(Name = "Remember me?")]
    public bool RememberMe { get; set; }
}

 

 

 

3. For JSON parameter submission:

Request Header:

User-Agent: Fiddler

 Host: localhost:4217

 Content-Type: application/json; charset=utf-8

Request Body

{“Number1″:”7″,”Number2″:”7″}

 

 

Fiddler Post Debug,布布扣,bubuko.com

Fiddler Post Debug

标签:style   blog   class   c   code   java   

原文地址:http://www.cnblogs.com/newr2006/p/3739542.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!