使用POSTMAN提交表单

时间:2018-05-28 01:06:47

标签: api postman

我正在尝试从POSTMAN登录网页。基本上,我必须提交一份表格。表格数据发布在下面,

<form action="https://www.revcontent.com/login" method="post" accept-charset="utf-8" class="cmxform animated flipInY" id="altForm" role="form"><div style="display:none">
<input type="hidden" name="rv_tsvm" value="919fb358fe5028ed53d40fca59766df0">
</div>                
        <div class="sign-body">
            <input type="hidden" name="desk" value="false">
                        <div class="form-group">
                <div class="input-group input-group-lg  no-overflow ">
                    <input type="text" class="form-control" placeholder="Username or E-mail" name="name" id="name" value="">
                    <span class="input-group-addon"><i class="fa fa-user"></i></span>
                </div>
            </div>
                        <div class="form-group">
                <div class="input-group input-group-lg no-overflow ">
                    <input type="password" class="form-control" placeholder="Password" name="password" id="password" value="">
                    <span class="input-group-addon"><i class="fa fa-lock"></i></span>
                </div>
                            </div>
            <div class="form-group">
                <input id="submitBtn" class="btn btn-primary btn-lg btn-block no-margin " type="submit" name="login" value="Sign In">
                                <p class="text-muted text-right forgot-link">Forgot your <a href="https://www.revcontent.com/login/forgot/username">username</a> or <a href="https://www.revcontent.com/login/forgot/password">password?</a></p>
                            </div>
        </div>
    </form>

所以,我有三个输入字段,

name : "user_name"
password : "password_site"
login : "Sign In"

在POSTMAN中,我选择了POST方法,URL为https://www.revcontent.com/login,我在body中定义了键和值。我可以使用相同的用户名和密码登录该站点。但是,在POSTMAN中,它无法正常工作。

enter image description here

它显示的错误,

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Error</title>
        <style type="text/css">

::selection{ background-color: #E13300; color: white; }
::moz-selection{ background-color: #E13300; color: white; }
::webkit-selection{ background-color: #E13300; color: white; }

body {
    background-color: #fff;
    margin: 40px;
    font: 13px/20px normal Helvetica, Arial, sans-serif;
    color: #4F5155;
}

a {
    color: #003399;
    background-color: transparent;
    font-weight: normal;
}

h1 {
    color: #444;
    background-color: transparent;
    border-bottom: 1px solid #D0D0D0;
    font-size: 19px;
    font-weight: normal;
    margin: 0 0 14px 0;
    padding: 14px 15px 10px 15px;
}

code {
    font-family: Consolas, Monaco, Courier New, Courier, monospace;
    font-size: 12px;
    background-color: #f9f9f9;
    border: 1px solid #D0D0D0;
    color: #002166;
    display: block;
    margin: 14px 0 14px 0;
    padding: 12px 10px 12px 10px;
}

#container {
    margin: 10px;
    border: 1px solid #D0D0D0;
    -webkit-box-shadow: 0 0 8px #D0D0D0;
}

p {
    margin: 12px 15px 12px 15px;
}
</style>
    </head>
    <body>
        <div id="container">
            <h1>An Error Was Encountered</h1>
            <p>The action you have requested is not allowed.</p>
        </div>
    </body>
</html>

1 个答案:

答案 0 :(得分:1)

您获得的错误是500内部服务器错误,这意味着它甚至没有检查您的登录凭据,并且应用程序的某些部分阻止您前往该路由。我也试过邮差,我也得到了同样的错误。罪魁祸首是cookies。所以,你还需要传递cookie。

这是我的邮递员工作链接。 (https://www.getpostman.com/collections/c8459b16c8fb6fbe01d6)。您可以直接在邮递员中导入它。确保传递正确的cookie,虚拟值不会起作用。

相关问题