Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does `GitHub Pages` allow HTTP "Post" method?

Tags:

git

html

http

post

php

I've programmed a little php Script, which just uploads a file from a user to the server.
I've tested in on my XAMMP Server locally, and everything worked fine.

But when i uploaded it to my GitHub Pages Here, It got this error 405 NOT ALLOWED
So i googled a lot and found out that i have to allow the HTTP Post Method.

My Question is now:
How do i allow POST method on my github page?

Thank you in advance.

like image 428
balex Avatar asked Jun 11 '16 09:06

balex


People also ask

Does GitHub Pages support HTML?

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website. You can see examples of GitHub Pages sites in the GitHub Pages examples collection.

Can we use API in GitHub Pages?

The GitHub Pages API allows you to interact with GitHub Pages sites and build information.

Can GitHub Pages have backend?

Github pages will not execute any serverside code. You may only upload static files (html,css,js, images, etc.). In order to have a hosted backend you should look for another service like Google Cloud, AWS Lambda, Heroku, etc.


1 Answers

GitHub pages can only serve static content, and there is no way to run PHP on GitHub pages or upload things. That's why GitHub doesn't allow POST requests.

If you need server side scripting (E.g. PHP), you'll need to use a web host which offers these things.

like image 147
JonasCz Avatar answered Oct 05 '22 20:10

JonasCz