Os dois métodos HTTP mais comuns são: GET e POST.
O que é HTTP?
O protocolo de transferência de hipertexto (HTTP, Hypertext Transfer Protocol) foi projetado para permitir a comunicação entre clientes e servidores. O HTTP funciona como um protocolo de solicitação-resposta entre um cliente e um servidor. Um navegador da Web pode ser o cliente e um aplicativo em um computador que hospeda um site da Web pode ser o servidor.
Exemplo: um cliente (navegador) envia uma solicitação HTTP ao servidor; então o servidor retorna uma resposta para o cliente. A resposta contém informações de status sobre a solicitação e também pode conter o conteúdo solicitado.
Métodos HTTP
- PEGUE POSTAR
- COLOCAR
- CABEÇA
- EXCLUIR
- PATCH OPÇÕES
O método GET
GET é usado para solicitar dados de um recurso especificado. GET é um dos métodos HTTP mais comuns.
Observe que a string de consulta (pares nome / valor) é enviada na URL de uma solicitação GET:
/test/demo_form.php?name1=value1&name2=value2
Algumas outras notas sobre solicitações GET:
- Solicitações GET podem ser armazenadas em cache
- As solicitações GET permanecem no histórico do navegador
- Solicitações GET podem ser marcadas
- As solicitações GET nunca devem ser usadas ao lidar com dados confidenciais
- Solicitações GET têm restrições de tamanho
- Pedidos GET são usados apenas para solicitar dados (não modificar
O método POST
O POST é usado para enviar dados para um servidor para criar / atualizar um recurso.
Os dados enviados ao servidor com o POST são armazenados no corpo da solicitação da solicitação HTTP:
POST /test/demo_form.php HTTP/1.1 Host: w3schools.com name1=value1&name2=value2
O POST é um dos métodos HTTP mais comuns.
Algumas outras notas sobre solicitações POST:
- As solicitações POST nunca são armazenadas em cache
- As solicitações POST não permanecem no histórico do navegador
- Pedidos POST não podem ser marcados
- Solicitações POST não têm restrições quanto ao tamanho dos dados
O método PUT
PUT é usado para enviar dados para um servidor para criar / atualizar um recurso.
A diferença entre POST e PUT é que as solicitações PUT são idempotentes. Ou seja, chamar a mesma solicitação PUT várias vezes sempre produzirá o mesmo resultado. Por outro lado, chamar uma solicitação POST repetidamente tem efeitos colaterais de criar o mesmo recurso várias vezes.
O método HEAD
HEAD é quase idêntico ao GET, mas sem o corpo de resposta.
Em outras palavras, se GET / users retornar uma lista de usuários, HEAD / users fará a mesma solicitação, mas não retornará a lista de usuários.
As solicitações HEAD são úteis para verificar o que uma solicitação GET retornará antes de fazer uma solicitação GET – como antes de fazer o download de um arquivo ou corpo de resposta grande.
O método DELETE
O método DELETE exclui o recurso especificado.
O método OPTIONS
O método OPTIONS descreve as opções de comunicação para o recurso de destino.
This is top-notch writing You’ve earned a unfamiliar follower.
You compel ought to an staggering capability faculty to erase open content online gambling casino.
Your insights are invaluable In reality appreciate your work.
I’ve just finished reading your latest blog post, and I must say, it’s outstanding! The depth of your analysis coupled with your engaging writing style made for an exceptional read. What struck me most was your ability to break down complex ideas into digestible, relatable content. Your examples and real-life applications brought the topic to life. I’ve gained a lot from your insights and am grateful for the learning. Keep up the fantastic work – your blog is a treasure trove of knowledge!
Your latest blog post truly resonated with me! The depth of insight and the clarity of your thoughts are commendable. It’s evident that you’ve put a lot of thought and research into this topic, and it shows. Your ability to present complex ideas in such an accessible and engaging manner is a rare skill. Thank you for sharing your knowledge and perspective – it’s been a thought-provoking read and I’m already looking forward to your next piece!
Wonderful work! This is the type of information that should be shared around the internet. Shame on Google for not positioning this post higher! Come on over and visit my site . Thanks =)
Wow that was odd. I just wrote an really long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyways, just wanted to say fantastic blog!
You actually make it seem so easy with your presentation but I find this topic to be really something that I think I would never understand. It seems too complex and very broad for me. I am looking forward for your next post, I’ll try to get the hang of it!
hi!,I like your writing so much! share we communicate more about your article on AOL? I require a specialist on this area to solve my problem. May be that’s you! Looking forward to see you.
I am extremely inspired with your writing talents as neatly as with the format to your weblog. Is that this a paid topic or did you modify it yourself? Either way stay up the excellent quality writing, it’s rare to look a great weblog like this one these days..
fantastic post, very informative. I wonder why the other specialists of this sector do not notice this. You should continue your writing. I’m confident, you’ve a huge readers’ base already!
Admiring the hard work you put into your blog and in depth information you provide. It’s awesome to come across a blog every once in a while that isn’t the same unwanted rehashed information. Great read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.
My brother suggested I might like this website. He was totally right. This post actually made my day. You can not imagine just how much time I had spent for this info! Thanks!
I precisely desired to appreciate you once more. I do not know the things that I would have undertaken without those recommendations shown by you over this topic. It truly was the depressing crisis in my view, nevertheless understanding the specialised mode you processed the issue took me to leap for delight. I’m just thankful for your help and as well , have high hopes you recognize what a great job you are always providing teaching most people with the aid of your site. I’m certain you have never encountered any of us.
Nice post. I was checking continuously this blog and I’m impressed! Very helpful information specifically the last part 🙂 I care for such info much. I was seeking this particular info for a long time. Thank you and best of luck.
was such an interesting read!
You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your blog.betflik
Howdy! Someone in my Facebook group shared this site with us so I came to look it over. I’m definitely enjoying the information. I’m book-marking and will be tweeting this to my followers! Excellent blog and fantastic style and design.
There is clearly a bundle to identify about this. I assume you made various nice points in features also.
thank you
You completed a number of nice points there. I did a search on the issue and found nearly all people will have the same opinion with your blog.betflik
what a great read!
I liked up to you will receive carried out right here. The comic strip is tasteful, your authored material stylish. however, you command get bought an nervousness over that you wish be handing over the following. unwell undoubtedly come more previously again since exactly the similar nearly very steadily within case you protect this hike.