Postar solicitação para incluir 'Content-Type' e JSON
Eu estou a trabalhar com goo.gl para encurtamento de URL. Eu preciso fazer o seguinte pedido:
POST https://www.googleapis.com/urlshortener/v1/url
Content-Type: application/json
{"longUrl": "http://www.google.com/"}
meu html: -
<form method="post" action="https://www.googleapis.com/urlshortener/v1/">
<button type="submit"> submit </button>
</form>
Como faço para adicionar o "tipo de conteúdo" e json aqui?