【发布时间】:2015-08-25 12:22:47
【问题描述】:
我正在使用 Greenhouse API 构建一个工作板,但在通过 SSL/TLS 的 HTTP 基本身份验证的最后一步获取工作申请表数据时有点卡住了。特别是 action="!!REQUEST 必须在您的服务器上代理!!"下面一点。
谁能指出我如何实现这个的正确方向:
描述:/applications 方法接受表示工作申请的多部分表单 POST。此方法需要基于 SSL/TLS 的 HTTP Basic Auth:Basic Auth 用户名是您的 API 密钥(可在 API Credentials 页面上找到),不需要密码。正确表示此方法所需数据的表单将从通过 /job API 方法可用的“问题”数组构造,这组字段是特定于作业的(更多详细信息可在作业方法文档中找到)。
https://api.greenhouse.io/v1/applications/
<!--
EXAMPLE FORM BELOW (simplified):
Please keep in mind that the HTTP Basic Auth API token is a secret key. Any form posts should be proxied by your own servers. Any direct post to the /applications POST method would reveal your secret key to anybody that views source--which would be a very bad thing.
-->
<form method="POST" action="!!REQUEST MUST BE PROXIED ON YOUR SERVERS!!" enctype='multipart/form-data'>
<!-- represents the ID of the job -->
<input type="hidden" name="id" value="55555" />
<!-- place the value of the gh_src URL parameter in the field below -->
<input type="hidden" name="mapped_url_token" />
<label>First Name <input type="text" name="first_name" /></label><br/>
<label>Last Name <input type="text" name="last_name" /></label><br/>
<label>Email <input type="text" name="email" /></label><br/>
<label>Phone <input type="text" name="phone" /></label><br/>
<label>Resume <input type="file" name="resume" /></label><br/>
<label>Cover Letter <input type="file" name="cover_letter" /></label><br/>
<label>LinkedIn Profile <input type="text" name="question_5555" /></label><br/>
<label>Some dropdown
<select name="question_3333">
<option></option>
<option value="1">Yes</option>
<option value="0">No</option>
</select>
</label><br/>
<label>Multi select with checkboxes<br/>
<label><input type="checkbox" name="question_2222[]" value="2" /> Red</label><br/>
<label><input type="checkbox" name="question_2222[]" value="5" /> Orange</label>
</label><br/>
<input type="submit" />
</form>
【问题讨论】:
-
“必须在您的服务器上代理” 表示您的服务器必须向其 API 发出 POST 请求。您是否研究过如何在您已经使用的任何语言/框架中执行此操作?
标签: api ssl http-proxy basic-authentication