bash.blade.php 1.1 KB

12345678910111213141516171819202122
  1. ```bash
  2. curl -X {{$route['methods'][0]}} \
  3. {{$route['methods'][0] == 'GET' ? '-G ' : ''}}"{{ rtrim($baseUrl, '/')}}/{{ ltrim($route['boundUri'], '/') }}@if(count($route['cleanQueryParameters']))?{!! \Knuckles\Scribe\Tools\WritingUtils::printQueryParamsAsString($route['cleanQueryParameters']) !!}@endif" @if(count($route['headers']))\
  4. @foreach($route['headers'] as $header => $value)
  5. -H "{{$header}}: {{ addslashes($value) }}"@if(! ($loop->last) || ($loop->last && count($route['bodyParameters']))) \
  6. @endif
  7. @endforeach
  8. @endif
  9. @if(count($route['fileParameters']))
  10. @foreach($route['cleanBodyParameters'] as $parameter => $value)
  11. @foreach( \Knuckles\Scribe\Tools\WritingUtils::getParameterNamesAndValuesForFormData($parameter,$value) as $key => $actualValue)
  12. -F "{!! "$key=".$actualValue !!}" \
  13. @endforeach
  14. @endforeach
  15. @foreach($route['fileParameters'] as $parameter => $file)
  16. -F "{!! "$parameter=@".$file->path() !!}" @if(! ($loop->last))\@endif
  17. @endforeach
  18. @elseif(count($route['cleanBodyParameters']))
  19. -d '{!! json_encode($route['cleanBodyParameters']) !!}'
  20. @endif
  21. ```