php - Where to make a POST to for crumbs url shortening service Advanced API -


i have php/javascript site (offline). using http://crum.bs/ shortening urls.

here, there 2 types of apis provided crum.bs:

  1. simple shorten, ,
  2. advanced shorten

i using simple shorten api. base url make request http://crum.bs/api.php?function=simpleshorten&url=[insert url here].

now, planning change advanced api requires post.

i can't find base anywhere on page (or in google). api reference page http://blog.crum.bs/?p=12. know is?

from see submit post request same path

http://crum.bs/api.php 

you need pass variables in request (which technically same simple version, different http verb used)

$ch = curl_init(); $curlconfig = array(     curlopt_url            => "http://crum.bs/api.php",     curlopt_post           => true,     curlopt_returntransfer => true,     curlopt_postfields     => array(         'url' => 'http://www.some-really-long-url.com/with/a/lot/of/text/etc.html',         'desc' => 'some other data',     ), ); curl_setopt_array($ch, $curlconfig); $result = curl_exec($ch); curl_close($ch); 

the $result var contain json response crum.bs service


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -