<commit_before><form id="hurl-form" method="post" action="/">
  <p>
    <% if prev = prev_hurl %>
      <a href="/hurls/<%= prev %>" id="page-prev" title="previous">&lang;</a>
    <% else %>
      <a href="#" style="display:none; "id="page-prev" title="previous">&lang;</a>
    <% end %>
    
    <% if nxt = next_hurl %>
      <a href="/hurls/<%= nxt %>" id="page-next" title="next">&rang;</a>
    <% elsif @user && @hurl.any? %>
      <a href="/" id="page-next" title="next">&rang;</a>
    <% else %>
      <a href="/" style="display:none;" id="page-next" title="next">&rang;</a>
    <% end %>
    
    <input type="text" name="url" title="URL" value="<%= @hurl['url'] %>"/>
  </p>
  <p>
    <select id="select-method" name="method" class="form-alpha">
      <option value="GET" <% if @hurl['method']=='GET' %>selected="selected"<% end %>>GET</option>
      <option value="POST" <% if @hurl['method']=='POST' %>selected="selected"<% end %>>POST</option>
      <option value="PUT" <% if @hurl['method']=='PUT' %>selected="selected"<% end %>>PUT</option>
      <option value="DELETE" <% if @hurl['method']=='DELETE' %>selected="selected"<% end %>>DELETE</option>
    </select>
    <span class="form-beta">
      <label>
      <input type="checkbox" id="follow_redirects" name="follow_redirects" 
        <% if @hurl['follow_redirects']=='on' %>checked="checked"<% end %> />
        follow redirects
      </label>
    </span>
    <div id="post-params" style="display: none;">
      <a id="add-param" href="#"><span class="link-icon">+</span> add param</a>
      <% if @hurl['param-keys'] %>
        <% @hurl['param-keys'].each_with_index do |name, i| %>
          <p id="param-fields">
            <a href="#" class="param-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
            <input type="text" name="param-keys[]" class="form-alpha" value="<%= name %>" />
            <input type="text" name="param-vals[]" class="form-beta" value="<%= @hurl['param-vals'][i] %>" />
          </p>            
        <% end %>
      <% else %>
        <p id="param-fields" style="display:none;">
          <a href="#" class="param-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
          <input type="text" name="param-keys[]" class="form-alpha"/>
          <input type="text" name="param-vals[]" class="form-beta" />
        </p>
      <% end %>
    </div>
  </p>
  <p id="auth-selection">
    <label>
      <input type="radio" name="auth" value="none" checked="checked"/>
      no auth
    </label>
    <label>
      <input type="radio" name="auth" value="basic" <% if @hurl['auth']=='basic'%>checked="checked"<% end %> />
      HTTP basic
    </label>
    <div id="basic-auth-fields" style="display:none;">
      <input type="text" name="username" class="form-alpha" title="username" value="<%= @hurl['username']%>"/>
      <input type="password" name="password" class="form-beta" title="password" value="<%= @hurl['password']%>"/>
    </div>
  </p>
  <p id="header-selection">
    <a id="add-header" href="#"><span class="link-icon">+</span> add header</a>
  </p>
  <% if @hurl['header-keys'] %>
    <% @hurl['header-keys'].each_with_index do |name, i| %>
      <p id="header-fields">
        <a href="#" class="header-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
        <input type="text" name="header-keys[]" class="form-alpha" value="<%= name %>" />
        <input type="text" name="header-vals[]" class="form-beta" value="<%= @hurl['header-vals'][i] %>" />
      </p>
    <% end %>
  <% else %>
    <p id="header-fields" style="display:none;">
      <a href="#" class="header-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
      <input type="text" name="header-keys[]" class="form-alpha"/>
      <input type="text" name="header-vals[]" class="form-beta"/>
    </p>
  <% end %>
  <p id="send-wrap" class="clearwrap">
    <button type="submit" class="bigbutton">Send</button>
    <img src="/img/ajax-loader.gif" id="spinner" />
  </p>
</form>
<div id="help-blurb" <% if logged_in? or not @hurl.empty? %>style="display: none;"<% end %>>
  <div id="help-text">
    <p>Hurl makes HTTP requests.</p>
    <p>Enter a URL, set some headers, view the response, then share it with others.</p>
    <p>Perfect for demoing and debugging APIs.</p>
  </div>
  <div id="try-it">
    <h4>Try it out:</h4>
    <ul class="examples">
      <% default_hurls.sort.each do |name, params| %>
        <li class="<%= name.split(' ').first.downcase %>"><a href="/hurls/<%= sha(params) %>"><%= name %></a></li>
     <% end %>
    </ul>
  </div>
</div>
<div id="request-and-response" <% if not @view %>style="display:none;"<% end %>>
  <div class="utils">
    <a href="<%= @view_id ? "/views/#{@view_id}" : "#" %>" class="full-size-link nav-item" target="_blank">view full size</a>
    <a href="<%= @view_id ? "/hurls/#{@hurl['id']}/#{@view_id}" : "#" %>" class="permalink nav-item">permalink</a>
  </div>
  <p>
    <span class="toggle-reqres" style="display: none;">
      <span class="tab-current">request</span> <a class="toggle-reqres-link" href="#">response</a>
    </span>
    <span class="toggle-reqres">
      <a class="toggle-reqres-link" href="#">request</a> <span class="tab-current">response</span><commit_msg>add "try-it" box for logged in users<commit_after><form id="hurl-form" method="post" action="/">
  <p>
    <% if prev = prev_hurl %>
      <a href="/hurls/<%= prev %>" id="page-prev" title="previous">&lang;</a>
    <% else %>
      <a href="#" style="display:none; "id="page-prev" title="previous">&lang;</a>
    <% end %>
    
    <% if nxt = next_hurl %>
      <a href="/hurls/<%= nxt %>" id="page-next" title="next">&rang;</a>
    <% elsif @user && @hurl.any? %>
      <a href="/" id="page-next" title="next">&rang;</a>
    <% else %>
      <a href="/" style="display:none;" id="page-next" title="next">&rang;</a>
    <% end %>
    
    <input type="text" name="url" title="URL" value="<%= @hurl['url'] %>"/>
  </p>
  <p>
    <select id="select-method" name="method" class="form-alpha">
      <option value="GET" <% if @hurl['method']=='GET' %>selected="selected"<% end %>>GET</option>
      <option value="POST" <% if @hurl['method']=='POST' %>selected="selected"<% end %>>POST</option>
      <option value="PUT" <% if @hurl['method']=='PUT' %>selected="selected"<% end %>>PUT</option>
      <option value="DELETE" <% if @hurl['method']=='DELETE' %>selected="selected"<% end %>>DELETE</option>
    </select>
    <span class="form-beta">
      <label>
      <input type="checkbox" id="follow_redirects" name="follow_redirects" 
        <% if @hurl['follow_redirects']=='on' %>checked="checked"<% end %> />
        follow redirects
      </label>
    </span>
    <div id="post-params" style="display: none;">
      <a id="add-param" href="#"><span class="link-icon">+</span> add param</a>
      <% if @hurl['param-keys'] %>
        <% @hurl['param-keys'].each_with_index do |name, i| %>
          <p id="param-fields">
            <a href="#" class="param-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
            <input type="text" name="param-keys[]" class="form-alpha" value="<%= name %>" />
            <input type="text" name="param-vals[]" class="form-beta" value="<%= @hurl['param-vals'][i] %>" />
          </p>            
        <% end %>
      <% else %>
        <p id="param-fields" style="display:none;">
          <a href="#" class="param-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
          <input type="text" name="param-keys[]" class="form-alpha"/>
          <input type="text" name="param-vals[]" class="form-beta" />
        </p>
      <% end %>
    </div>
  </p>
  <p id="auth-selection">
    <label>
      <input type="radio" name="auth" value="none" checked="checked"/>
      no auth
    </label>
    <label>
      <input type="radio" name="auth" value="basic" <% if @hurl['auth']=='basic'%>checked="checked"<% end %> />
      HTTP basic
    </label>
    <div id="basic-auth-fields" style="display:none;">
      <input type="text" name="username" class="form-alpha" title="username" value="<%= @hurl['username']%>"/>
      <input type="password" name="password" class="form-beta" title="password" value="<%= @hurl['password']%>"/>
    </div>
  </p>
  <p id="header-selection">
    <a id="add-header" href="#"><span class="link-icon">+</span> add header</a>
  </p>
  <% if @hurl['header-keys'] %>
    <% @hurl['header-keys'].each_with_index do |name, i| %>
      <p id="header-fields">
        <a href="#" class="header-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
        <input type="text" name="header-keys[]" class="form-alpha" value="<%= name %>" />
        <input type="text" name="header-vals[]" class="form-beta" value="<%= @hurl['header-vals'][i] %>" />
      </p>
    <% end %>
  <% else %>
    <p id="header-fields" style="display:none;">
      <a href="#" class="header-delete"><img class="delete" src="/img/delete.png" title="remove"/></a>
      <input type="text" name="header-keys[]" class="form-alpha"/>
      <input type="text" name="header-vals[]" class="form-beta"/>
    </p>
  <% end %>
  <p id="send-wrap" class="clearwrap">
    <button type="submit" class="bigbutton">Send</button>
    <img src="/img/ajax-loader.gif" id="spinner" />
  </p>
</form>
<div class="help-blurb" <% if logged_in? or not @hurl.empty? %>style="display: none;"<% end %>>
  <div id="help-text">
    <p>Hurl makes HTTP requests.</p>
    <p>Enter a URL, set some headers, view the response, then share it with others.</p>
    <p>Perfect for demoing and debugging APIs.</p>
  </div>
</div>
<div class="help-blurb" <% if @user and not @hurl.empty? %>style="display: none;"<% end %>>
 <div id="try-it">
    <h4>Try it out:</h4>
    <ul class="examples">
      <% default_hurls.sort.each do |name, params| %>
        <li class="<%= name.split(' ').first.downcase %>"><a href="/hurls/<%= sha(params) %>"><%= name %></a></li>
     <% end %>
    </ul>
  </div>
</div>
<div id="request-and-response" <% if not @view %>style="display:none;"<% end %>>
  <div class="utils">
    <a href="<%= @view_id ? "/views/#{@view_id}" : "#" %>" class="full-size-link nav-item" target="_blank">view full size</a>
    <a href="<%= @view_id ? "/hurls/#{@hurl['id']}/#{@view_id}" : "#" %>" class="permalink nav-item">permalink</a>
  </div>
  <p>
    <span class="toggle-reqres" style="display: none;">
      <span class="tab-current">request</span> <a class="toggle-reqres-link" href="#">response</a>
    </span>
    <span class="toggle-reqres">
      <a class="toggle-reqres-link" href="#">request</a> <span class="tab-current">response</span>
{'fraction_non_alphanumeric': 0.25177503736920775, 'fraction_numerical': 0.0003736920777279522, 'mean_word_length': 3.436386241193535, 'pattern_counts': {'":': 0, '<': 361, '<?xml version=': 0, '>': 361, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2682158', 'n_tokens_mistral': 3895, 'n_tokens_neox': 3712, 'n_words': 758}