Browse Source

use -X METHOD for bash example (#136)

* use -X METHOD for bash example

* Make test pass

* That white space

* Update route.blade.php
Mark 8 years ago
parent
commit
12abacdb9e
2 changed files with 9 additions and 9 deletions
  1. 2 2
      src/resources/views/partials/route.blade.php
  2. 7 7
      tests/Fixtures/resource_index.md

+ 2 - 2
src/resources/views/partials/route.blade.php

@@ -10,7 +10,7 @@
 > Example request:
 
 ```bash
-curl "{{config('app.url')}}/{{$parsedRoute['uri']}}" \
+curl -X {{$parsedRoute['methods'][0]}} "{{config('app.url')}}/{{$parsedRoute['uri']}}" \
 -H "Accept: application/json"@if(count($parsedRoute['parameters'])) \
 @foreach($parsedRoute['parameters'] as $attribute => $parameter)
     -d "{{$attribute}}"="{{$parameter['value']}}" \
@@ -65,4 +65,4 @@ Parameter | Type | Status | Description
 @endforeach
 @endif
 
-<!-- END_{{$parsedRoute['id']}} -->
+<!-- END_{{$parsedRoute['id']}} -->

+ 7 - 7
tests/Fixtures/resource_index.md

@@ -27,7 +27,7 @@ Welcome to the generated API reference.
 > Example request:
 
 ```bash
-curl "http://localhost/api/user" \
+curl -X GET "http://localhost/api/user" \
 -H "Accept: application/json"
 ```
 
@@ -68,7 +68,7 @@ $.ajax(settings).done(function (response) {
 > Example request:
 
 ```bash
-curl "http://localhost/api/user/create" \
+curl -X GET "http://localhost/api/user/create" \
 -H "Accept: application/json"
 ```
 
@@ -109,7 +109,7 @@ $.ajax(settings).done(function (response) {
 > Example request:
 
 ```bash
-curl "http://localhost/api/user" \
+curl -X POST "http://localhost/api/user" \
 -H "Accept: application/json"
 ```
 
@@ -141,7 +141,7 @@ $.ajax(settings).done(function (response) {
 > Example request:
 
 ```bash
-curl "http://localhost/api/user/{user}" \
+curl -X GET "http://localhost/api/user/{user}" \
 -H "Accept: application/json"
 ```
 
@@ -182,7 +182,7 @@ $.ajax(settings).done(function (response) {
 > Example request:
 
 ```bash
-curl "http://localhost/api/user/{user}/edit" \
+curl -X GET "http://localhost/api/user/{user}/edit" \
 -H "Accept: application/json"
 ```
 
@@ -223,7 +223,7 @@ $.ajax(settings).done(function (response) {
 > Example request:
 
 ```bash
-curl "http://localhost/api/user/{user}" \
+curl -X PUT "http://localhost/api/user/{user}" \
 -H "Accept: application/json"
 ```
 
@@ -257,7 +257,7 @@ $.ajax(settings).done(function (response) {
 > Example request:
 
 ```bash
-curl "http://localhost/api/user/{user}" \
+curl -X DELETE "http://localhost/api/user/{user}" \
 -H "Accept: application/json"
 ```