fetching.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <div style="line-height: 2rem">
  3. <h2 class="primary--text">
  4. {{ $vuetify.lang.t("$vuetify.api.fetching.title") }}
  5. </h2>
  6. <div class="ma-2">
  7. {{ $vuetify.lang.t("$vuetify.api.fetching.subtitle") }}
  8. <a href="https://youtube.com/watch?v=kxOuG8jMIgI" target="_blank">
  9. kxOuG8jMIgI
  10. </a>
  11. </div>
  12. <h3 class="mt-6">{{ $vuetify.lang.t("$vuetify.api.fetching.title2") }}</h3>
  13. <div class="ma-2">
  14. {{ $vuetify.lang.t("$vuetify.api.fetching.url") }}
  15. <a
  16. :href="apiUrl + '/votes?videoId=kxOuG8jMIgI'"
  17. target="_blank"
  18. v-text="apiUrl + '/votes?videoId=kxOuG8jMIgI'"
  19. />
  20. <br />
  21. {{ $vuetify.lang.t("$vuetify.api.fetching.method") }}
  22. <a
  23. href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/GET"
  24. target="_blank"
  25. >
  26. HTTP/GET
  27. </a>
  28. </div>
  29. <div class="mt-4 ml-2">
  30. {{ $vuetify.lang.t("$vuetify.api.fetching.headers") }}
  31. </div>
  32. <div class="code px-4 py-2">
  33. Accept: text/html,application/xhtml+xml,application/xml;q=0.9<br />
  34. Pragma: no-cache<br />
  35. Cache-Control: no-cache<br />
  36. Connection: keep-alive
  37. </div>
  38. <div class="mt-4 ml-2">
  39. {{ $vuetify.lang.t("$vuetify.api.fetching.response") }}
  40. </div>
  41. <div class="code px-4 py-2">
  42. {
  43. <br />
  44. &nbsp;"id": "kxOuG8jMIgI",<br />
  45. &nbsp;"dateCreated": "2021-12-20T12:25:54.418014Z",<br />
  46. &nbsp;"likes": 27326,<br />
  47. &nbsp;"dislikes": 498153,<br />
  48. &nbsp;"rating": 1.212014408444885,<br />
  49. &nbsp;"viewCount": 3149885,<br />
  50. &nbsp;"deleted": false<br />
  51. }
  52. </div>
  53. <br />
  54. <v-alert border="left" color="orange" text type="info" class="mb-0">
  55. <span>{{ $vuetify.lang.t("$vuetify.api.fetching.error1") }}</span>
  56. <br />
  57. <span>{{ $vuetify.lang.t("$vuetify.api.fetching.error2") }}</span>
  58. </v-alert>
  59. </div>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. apiUrl: process.env.apiUrl,
  66. };
  67. },
  68. };
  69. </script>
  70. <style scoped>
  71. .code {
  72. color: #aaa;
  73. background: #353535;
  74. border-radius: 0.5rem;
  75. font-family: monospace;
  76. line-height: 2rem;
  77. }
  78. </style>