Skip to content

Commit

Permalink
PHP and curl HEAD HTTP method support origin
Browse files Browse the repository at this point in the history
  • Loading branch information
zdne committed Mar 20, 2013
1 parent bc5ff35 commit 025ea90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion curl.html
@@ -1,7 +1,8 @@
<section name="curl" class="curl">
<p class="ioDesc">Request</p>
<pre class="incoming"><code class="language-bash">curl --include<% if @headers: %><% for header,value of @headers: %> --header <%= @helpers.escape "#{header}: #{value}" %><% end %> \
<% end %><% if @method isnt 'GET' or @body: %> --request <%= @method %> \
<% end %><% if @method is 'HEAD' : %> -I \
<% else if @method isnt 'GET' or @body: %> --request <%= @method %> \
<% end %><% if @body: %> --data-binary "<%= @body.replace(/(['"])/g, "\\$1") %>" \
<% end %>"<%= @apiUrl %><%= @url %>"</code></pre>
</section>
3 changes: 3 additions & 0 deletions php.html
Expand Up @@ -9,6 +9,9 @@
<% if @method is 'POST': %>
curl_setopt($ch, CURLOPT_POST, TRUE);
<% end %>
<% if @method is 'HEAD': %>
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
<% end %>
<% if @method isnt 'GET' and @method isnt 'POST': %>
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "<%= @method %>");
<% end %>
Expand Down

0 comments on commit 025ea90

Please sign in to comment.