Permalink
Browse files

PHP and curl HEAD HTTP method support origin

  • Loading branch information...
1 parent bc5ff35 commit 025ea90caba081fb6fc8cfffaf19e745c0a22aa6 @zdne zdne committed Mar 20, 2013
Showing with 5 additions and 1 deletion.
  1. +2 −1 curl.html
  2. +3 −0 php.html
View
@@ -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>
View
@@ -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 %>

0 comments on commit 025ea90

Please sign in to comment.