Post request to include 'Content-Type' and JSON

Posted by Sangram Singh on Stack Overflow See other posts from Stack Overflow or by Sangram Singh
Published on 2013-10-18T09:46:45Z Indexed on 2013/10/18 9:54 UTC
Read the original article Hit count: 228

Filed under:
|
|

I'm to work with goo.gl for URL shortening. I need to make the following request:

POST https://www.googleapis.com/urlshortener/v1/url
Content-Type: application/json
{"longUrl": "http://www.google.com/"}

my html:-

<form method="post" action="https://www.googleapis.com/urlshortener/v1/">
    <button type="submit"> submit </button>
</form>

how do i add the 'content-type' and json here?

© Stack Overflow or respective owner

Related posts about html

Related posts about http