Skip to content
YKTechHubInc

개발

샘플 데이터.

앱을 시험할 때 부를 수 있는 사람, 글, 상품 예시.

책상 위 노트북. 옆에는 식물과 노란 컵.

그림

160 by 160 placeholder300 by 120 placeholder90 by 160 placeholder128 by 160 placeholder

주소

{
  "id": 1,
  "slug": "electronics",
  "name": "Electronics",
  "width": 1200,
  "height": 630,
  "image": "/mock/img/1200x630",
  "count": 3,
  "products": [
    {
      "id": 1,
      "name": "Pocket phone",
      "price": 429,
      "category": "electronics",
      "width": 400,
      "height": 400,
      "image": "/mock/img/400x400"
    },
    {
      "id": 2,
      "name": "Studio headphones",
      "price": 89,
      "category": "electronics",
      "width": 800,
      "height": 600,
      "image": "/mock/img/800x600"
    },
    {
      "id": 3,
      "name": "Compact keyboard",
      "price": 74,
      "category": "electronics",
      "width": 1200,
      "height": 480,
      "image": "/mock/img/1200x480"
    }
  ]
}

부르는 방법

No key. Any site can call these. A normal read is cached for a day. A write is not.

목록과 하나

Lists are /mock/users, /mock/posts, /mock/comments, /mock/products, and /mock/categories. One record adds the id: /mock/users/1. A category also accepts its slug, as in /mock/categories/electronics.

거르기

userId, postId, and category keep the matching records. q searches the fields. limit is at most 100. offset skips that many records. A list answers with data, total, limit, and offset.

그림

/mock/img/640x480 returns an SVG. Width and height run from 16 to 2000. status and delay do not apply to pictures.

쓰기

POST /mock/products with a JSON body. The same JSON comes back with HTTP 201, and the list does not change. PUT /mock/users/1 returns the body you sent. DELETE /mock/users/1 returns that body, or deleted and the id when you send none. The next read still has the original record. The body is 100000 characters or fewer.

실패

status sets the HTTP status and still returns the same JSON. Use an integer from 200 to 599. 204, 205, and 304 are refused, because they cannot carry JSON. delay waits that many milliseconds, up to 10000, then returns the same JSON. Both can be used together: /mock/products?status=503&delay=1500.

A missing collection or record is 404. status and delay do not change that. A simulated response is not cached.