body.html 817 B

123456789101112131415161718192021222324252627282930313233
  1. {{ define "body" }}
  2. <h6>
  3. {{ with len .BodyBytes }} {{ . }} bytes, {{ end }}
  4. {{ with .Header.Get "Content-Type" }}{{.}}{{end}}
  5. </h6>
  6. {{ with $json := handleJson .BodyBytes .Header }}
  7. <pre><code class="json">{{ $json.Str }}</code></pre>
  8. {{ with $json.Err }}
  9. <div class="alert">{{ $json.Err }}</div>
  10. {{ end }}
  11. {{ end }}
  12. {{ with $form := handleForm .BodyBytes .Header }}
  13. <h6>Form Params</h6>
  14. <table class="table params">
  15. {{ range $key, $values := $form }}
  16. {{ range $value := $values }}
  17. <tr>
  18. <th>{{ $key }}</th>
  19. <td>{{ $value }}</td>
  20. </tr>
  21. {{ end }}
  22. {{ end }}
  23. </table>
  24. {{ end }}
  25. {{ with handleOther .BodyBytes .Header }}
  26. <pre> <code class="{{.Syntax}}">{{.Body}}</code> </pre>
  27. {{ end }}
  28. {{ end }}