Skip to content

Tag: rest

PHP json_encode to C# Object unable to convert

I have this array of objects that contains some strings and an array of strings that I want to return from my server: “[{“original_file_name”:”Plain_HAIR.pdf”,”encrypted_file_name”:”UTTSJG13V1EC46J.pdf”,”is_successful”:true,”message&#8221…

api versioning page not found

I’m trying to create my 1st API on Laravel 8, and want to create versioning that would look like this My user controller looks like this in my config/app.php i have this ‘api_latest’ => ‘1’, in my middleware (appHttpMiddlewareAPIVersion.php) in my kernal (app/http/kernel.php) …

What are the ways of sending images to my server?

I’m mostly a PHP backend / HTML/CSS frontend developer, so I’ve always sent images to my server from the client using either form enctype: multipart/formdata or through a FormData object when uploading through ajax requests. After that I would receive the file in the $_FILES array. Lately I’…

Can’t perform a PHP POST request on mysql database

I’m struggling into do my first API in php and I’m facing some problems with a simple POST request. I’ve searched almost everywhere for some alternatives to my code, but it seems to be ok. Can you guys check it for me the last time? Thank you! method: create.php: Answer ok, so I managed to r…

How make a many-to-many rest API in yii2

I’m trying to get a many-to-may relationship to work, but I can’t get it to work. I have a database with 3 tables: users, favorites & videos. The favorites table contains 2 foreign keys that point to the users table and the videos table. Currently I have the following: User Model: Video Model:…