APIs e webservices


A sigla API significa Application Programming Interface , ou em português interface de programação de aplicação , tratam-se de mecanismos para expor as funcionalidades de uma determinada aplicação para serem consumidas programaticamente por outra aplicação possibilitando a integração entre elas.A implementação de uma API pode se dar de diferentes maneiras ,por exemplo:

acesse o site do google(https://www.google.com/) aperte o botão direito do mouse dentro do site e selecione a opção inspecionar para abrir o devtools do seu navegador

 

 APIs e webservices
APIs e webservices

No devtools vá para a aba console e no console escreva ‘ document.body.style.backgroundColor = “red” ‘ e pressione a tecla enter você verá que a cor de fundo do site do google mudará para vermelho .

 APIs e webservices
APIs e webservices

Neste exemplo estamos utilizando uma API do navegador para manipular o DOM(Document Object Model) de uma página e alterar a cor de fundo do elemento body, . As APIs do navegador não fazem parte da linguagem javascript , elas são escritas sobre o core da linguagem, fazem parte do navegador e são capazes fornecer informações e manipular recursos do navegador bem como do computador no qual o navegador está rodando para assim empoderar o código dos desenvolvedores com essas funcionalidades.

A API neste caso funciona como uma biblioteca embarcada no navegador , a interface para as funcionalidades se dá por meio dos atributos e métodos do objeto document , por exemplo , document.body nos permite acessar outro objeto que representa a elemento <body> do nosso html ,e o objeto body tem o atributo style que contém o outro objeto cujo os atributos representam os estilos aplicados ao elemento   , como o backgroundColor , alterando esses  atributos é possível alterar os estilos aplicados em body diretamente. Entretanto nem sempre as APIs são implementadas dessa forma é muito comum que a interface de uma API sejam requisições HTTP ao invés de um objeto , este tipo de api também é conhecido como web service .

Um web service  pode ser definido como um sistema de software projetado para suportar interação interoperável entre máquinas(aplicações) em uma rede. Possui uma interface descrita em formato processável por máquina . Outros sistemas interagem com o Web service de uma maneira prescrita pela sua documentação, normalmente usando HTTP com outros padrões relacionados à Web [https://www.w3.org/TR/ws-arch/#whatis,adaptado]. Pode-se afirmar que todo webservice é uma API mas nem toda API é um webservice , pois  webservices são apis que funcionam através de  uma rede .

Por exemplo o web service viacep.com.br ofereçe a funcionalidade de consultar os dados de um endereço pelo cep  , na documentação do Webservice é fornecida a url https://viacep.com.br/ws/01001000/json , se tentar acessar esta url verá que ao invés de um site  terá apenas  dados referentes ao cep na url . 

A grande vantagem dos webservices esta interoperabilidade , a capacidade de um sistema se comunicar de forma transparente ,  como o serviço é consumido através do protocolo HTTP ,que é amplamente suportado pelas linguagens de programação no geral, ele pode ser utilizado pelos mais variados clientes como um aplicativo no celular , um site ou até mesmo por uma planilha do excel.

referencias 

https://www.redhat.com/pt-br/topics/api/what-are-application-programming-interfaces

https://aws.amazon.com/pt/what-is/api/

https://www.w3.org/TR/ws-arch/#whatis
https://developer.mozilla.org/pt-BR/docs/Learn/JavaScript/Client-side_web_APIs/Introduction

Aproveite e conheça nossos serviços..

Desenvolvimento de Aplicações.

 

Categories

Tags

Comments (21)

  • hgh jintropin

    References:

    Hgh results after 1 month bodybuilding (output.jsbin.com)

  • Undeniably believe that which you stated. Your favorite justification appeared to be on the internet the simplest thing to be aware of.
    I say to you, I certainly get irked while people think about worries that
    they plainly do not know about. You managed to hit the nail upon the top as
    well as defined out the whole thing without having side-effects ,
    people could take a signal. Will likely be back
    to get more. Thanks

  • Magnificent website. A lot of helpful info here. I am sending it
    to some friends ans also sharing in delicious.
    And certainly, thanks in your effort!

  • Hi to every , since I am really keen of reading this webpage’s post to be
    updated regularly. It contains good material.

  • I think the admin of this web page is actually working hard in favor of his web site, because here every data is quality based data.

  • 5 iu hgh per day results

    References:

    How Many Hgh Injections Should I Take (https://Topspots.Cloud/Item/413553)

  • sytropin hgh ingredients

    References:

    how many iu Of hgh per Day for muscle growth

  • 2 iu hgh fettverbrennung

    References:

    does skipping increase hgh (https://salemshop.Kz/user/Goatoil5)

  • hgh dosage for women

    References:

    test and hgh (hedgedoc.eclair.ec-lyon.fr)

  • This is a topic that’s close to my heart…
    Take care! Exactly where are your contact details though?

  • These https://joyorganics.com/products/delta-9-gummies-blackberry-lime are a pre-eminent compare of suggestion and relaxation. The flavor is logically honeyed, without any bitter aftertaste, and the nature is pleasantly soft. I noticed a calming accomplish within fro 30 minutes, portion me unwind after a extended broad daylight without sensibility drowsy. They’re quiet to take on the survive and traverse continuously CBD function enjoyable. Ardent rank, consonant dosage, and a delightful manner to go through the benefits of CBD

  • Thanks a lot for sharing this with all folks you really know what
    you’re speaking approximately! Bookmarked. Please additionally visit
    my website =). We will have a link change contract between us

  • This article is in fact a nice one it assists new net people, who are wishing in favor of blogging.

  • My brother suggested I might like this blog.
    He was entirely right. This post truly made my day. You
    can not imagine just how much time I had spent for this info!
    Thanks!

  • Hey There. I found your blog using msn. This is a very well written article.
    I’ll make sure to bookmark it and come back to read more of your useful info.

    Thanks for the post. I will definitely comeback.

  • This is my first time visit at here and i am actually happy to read
    everthing at single place.

  • Tried the https://www.cornbreadhemp.com/products/thc-gummies-10mg from Cornbread Hemp — the understanding with a be together of THC. Took one before bed. The flavor’s competent, measure dirty but pleasant. About an hour later, I felt noticeably more nonchalant — not lethargic, lawful peacefulness adequate to wander off without my tell off racing. Woke up with no morning grogginess, which was a minute surprise. They’re on the pricier side, but if you struggle to unwind at darkness, they could be advantage it.

  • Hi! I simply would like to give you a big thumbs up for your excellent
    information you’ve got here on this post. I’ll be returning to your blog for
    more soon.

  • It’s very straightforward to find out any matter on net as compared to books, as I
    found this paragraph at this website.

  • Way cool! Some extremely valid points! I appreciate you writing this
    write-up plus the rest of the site is also really good.

  • My programmer is trying to convince me to move
    to .net from PHP. I have always disliked the idea because of the costs.
    But he’s tryiong none the less. I’ve been using Movable-type on a variety of websites for
    about a year and am concerned about switching to another platform.
    I have heard good things about blogengine.net.
    Is there a way I can transfer all my wordpress content
    into it? Any help would be greatly appreciated!

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *