PHP Classes

File: tests/tests_phpstorm/posts.http

Recommend this page to a friend!
  Classes of Insolita   Yii2 Fractal   tests/tests_phpstorm/posts.http   Download  
File: tests/tests_phpstorm/posts.http
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Yii2 Fractal
Components to implement API based on JSON:API
Author: By
Last change:
Date: 13 days ago
Size: 6,861 bytes
 

Contents

Class file image Download
### Index HEAD HEAD http://127.0.0.1:8400/posts Accept: application/vnd.api+json ### Index OPTIONS OPTIONS http://127.0.0.1:8400/posts Accept: application/vnd.api+json ### Index GET http://127.0.0.1:8400/posts Accept: application/vnd.api+json ### Index filtered GET http://127.0.0.1:8400/posts?include=category&filter[category_id][neq]=1&filter[author_id][eq]=1 Accept: application/vnd.api+json ### Index filtered HEAD http://127.0.0.1:8400/posts?include=category&filter[category_id][neq]=1&filter[author_id][eq]=1 Accept: application/vnd.api+json ### Index paged GET http://127.0.0.1:8400/posts?page[size]=10&page[number]=5 Accept: application/vnd.api+json ### Index paged HEAD http://127.0.0.1:8400/posts?page[size]=10&page[number]=5 Accept: application/vnd.api+json ### Index with fields GET http://127.0.0.1:8400/posts?fields[posts]=name,category_id,author_id&page[size]=10&page[number]=4 Accept: application/vnd.api+json ### Index with includes GET http://127.0.0.1:8400/posts?page[size]=3&sort=name&include=category,author&fields[posts]=id,name, category_id, author_id,category,author Accept: application/vnd.api+json ### Index with bad includes GET http://127.0.0.1:8400/posts?page[size]=3&sort=name&include=comments Accept: application/vnd.api+json ### Index with filter GET http://127.0.0.1:8400/posts?fields[posts]=name,category_id&filter[name][like]=omnis&filter[category_id][neq]=3 Accept: application/vnd.api+json ### Index with joins GET http://127.0.0.1:8400/posts-join?sort=-category.id&include=category Accept: application/vnd.api+json ### View Unaccessible GET http://127.0.0.1:8400/posts/3?include=author Accept: application/vnd.api+json ### View GET http://127.0.0.1:8400/posts/43 Accept: application/vnd.api+json ### View fields GET http://127.0.0.1:8400/posts/43?fields[posts]=name,category_id,author_id Accept: application/vnd.api+json ### View fields, with unexisted GET http://127.0.0.1:8400/posts/43?fields[posts]=name,publish_date Accept: application/vnd.api+json ### View fields, include GET http://127.0.0.1:8400/posts/43?fields[posts]=name,category_id,author_id&include=author,category Accept: application/vnd.api+json ### View fields, include HEAD http://127.0.0.1:8400/posts/43?fields[posts]=name,category_id,author_id&include=author,category Accept: application/vnd.api+json ### Create POST http://127.0.0.1:8400/posts Content-Type: application/vnd.api+json { "data": { "type": "posts", "attributes": { "category_id": 2, "name": "My some post", "body": "The quick brown fox jumps over the lazy dog" } } } ### Create Invalid POST http://127.0.0.1:8400/posts Content-Type: application/vnd.api+json { "data": { "type": "posts", "attributes": { "name": "My first post" } } } ### Delete DELETE http://127.0.0.1:8400/posts/55 ### UPDATE PATCH http://127.0.0.1:8400/posts/56 Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": { "id": 56, "type": "posts", "attributes": { "name": "Updated Post Title" } } } ### List for user GET http://127.0.0.1:8400/users/1/posts?sort=-id Accept: application/vnd.api+json ### List for category GET http://127.0.0.1:8400/categories/1/posts Accept: application/vnd.api+json ### View for category GET http://127.0.0.1:8400/categories/3/posts/12 Accept: application/vnd.api+json ### View for category invalid GET http://127.0.0.1:8400/categories/2/posts/1 Accept: application/vnd.api+json ### Relationships category GET http://127.0.0.1:8400/posts/26/relationships/category Accept: application/vnd.api+json ### Delete Relationships category (must be failed) DELETE http://127.0.0.1:8400/posts/26/relationships/category Accept: application/vnd.api+json ### Relationships author GET http://127.0.0.1:8400/posts/26/relationships/author Accept: application/vnd.api+json ### Relationships comments GET http://127.0.0.1:8400/posts/26/relationships/comments Accept: application/vnd.api+json ### Relationships comments bad delete DELETE http://127.0.0.1:8400/posts/26/relationships/comments Accept: application/vnd.api+json Content-Type: application/vnd.api+json { "data": [ {"id": 1, "type": "comments"} ] } ### Relationships comments valid delete DELETE http://127.0.0.1:8400/posts/26/relationships/comments Accept: application/vnd.api+json Content-Type: application/vnd.api+json { "data": [ {"id": 54, "type": "comments"} ] } ### Relationships comments GET http://127.0.0.1:8400/posts/12/relationships/comments Accept: application/vnd.api+json ### Relationships comments HEAD http://127.0.0.1:8400/posts/12/relationships/comments Accept: application/vnd.api+json ### GET comments GET http://127.0.0.1:8400/comments Content-Type: application/vnd.api+json Accept: application/vnd.api+json ### HEAD comments HEAD http://127.0.0.1:8400/comments Content-Type: application/vnd.api+json Accept: application/vnd.api+json ### Create comments POST http://127.0.0.1:8400/comments Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": { "type": "comments", "attributes": { "user_id": 2, "message": "xxx yyy zzz", "created_at": "2020-02-02 02:02:20" } } } ### Send Bad Data POST http://127.0.0.1:8400/posts/12/relationships/comments Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": [ {"id": 3333354, "type": "comments"} ] } ### Send Bad Data POST http://127.0.0.1:8400/posts/12/relationships/comments Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": [ {"id": "", "type": "comments"} ] } ### Send Bad Data POST http://127.0.0.1:8400/posts/12/relationships/comments Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": [ {"id": "' OR 1=1", "type": "comments"} ] } ### Send Bad Data POST http://127.0.0.1:8400/posts/12/relationships/comments Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "data": [ {"id": [2], "type": "comments"} ] } ### Count posts HEAD http://127.0.0.1:8400/post/count Content-Type: application/vnd.api+json Accept: application/vnd.api+json ### Count posts for user HEAD http://127.0.0.1:8400/post/count?filter[author_id]=3 Content-Type: application/vnd.api+json Accept: application/vnd.api+json ### Count posts for identity HEAD http://127.0.0.1:8400/me/posts-count Content-Type: application/vnd.api+json Accept: application/vnd.api+json Authorization: Bearer Gamma_secret_token ### Count posts for category HEAD http://127.0.0.1:8400/categories/4/posts-count Content-Type: application/vnd.api+json Accept: application/vnd.api+json