dummy-link

Curl

a Julia HTTP curl library

Readme

DEPRECATED - THIS LIBRARY IS NO LONGER MAINTAINED.

Please see Requests.jl and LibCURL.jl for all your HTTP client needs.


Curl.jl

A little Julia client HTTP library. Curl.jl supports basic HTTP method usage (GET, POST, DELETE ...) for making requests to HTTP web servers.

Installation

  • Install Julia
  • From the Julia console Pkg.init() if not already done so
  • julia> Pkg.update(); Pkg.add("Curl"); using Curl

Examples

  julia> using Curl

  julia> using JSON

  julia> Curl.get("http://jsonip.com").text
  "{\"ip\":\"24.4.140.175\",\"about\":\"/about\"}"

  julia> Curl.get("http://jsonip.com").headers[1]
  9-element String Array:
   "HTTP/1.1 200 OK"
   "Server: nginx/1.2.6"
   "Date: Sun, 24 Feb 2013 03:34:17 GMT"
   "Content-Type: application/json"
   "Transfer-Encoding: chunked"
   "Connection: keep-alive"
   "Vary: Accept-Encoding"
   "Access-Control-Allow-Origin: *"
   "Access-Control-Allow-Methods: GET"

  julia> JSON.parse(Curl.get("http://jsonip.com").text)["ip"]
  "24.4.140.175"

  julia> Curl.post("http://requestb.in/181n1gk1", { :arg1 => "var1" }).text
  "ok\n"

  julia> Curl.delete("http://requestb.in/181n1gk1").text
  "ok\n"

  julia> Curl.head("http://requestb.in/181n1gk1").text
  ""

  julia> Curl.get("http://nytimes.com").text[1:92]
  "\n \n\n\nThe New York Times "

  julia> Curl.get("http://nytimes.com").headers[2]
  12-element String Array:
   "HTTP/1.1 200 OK"
   "Date: Sun, 24 Feb 2013 03:36:02 GMT"
   "Server: Apache"
   "expires: Thu, 01 Dec 1994 16:00:00 GMT"
   "cache-control: no-cache"
   "pragma: no-cache"
   "Set-Cookie: RMID=007f0100629751298aa2003f; Expires=Mon, 24 Feb 2014 03:36:02 GMT; Path=/; Domain=.nytimes.com;"
   "Set-cookie: adxcs=-; path=/; domain=.nytimes.com"
   "Vary: Host"
   "Content-Length: 168147"
   "Connection: close"
   "Content-Type: text/html; charset=UTF-8"

  julia> Curl.options("http://thestar.com.my").headers[1]
  9-element String Array:
   "HTTP/1.1 200 OK"
   "Cache-Control: max-age=60"
   "Allow: OPTIONS, TRACE, GET, HEAD, POST"
   "Content-Length: 0"
   "Server: Microsoft-IIS/7.5"
   "Public: OPTIONS, TRACE, GET, HEAD, POST"
   "X-Powered-By: ARR/2.5"
   "X-Powered-By: ASP.NET"
   "Date: Thu, 28 Feb 2013 01:28:42 GMT"

  julia> Curl.patch("http://requestb.in/s5sgk7s5", { :arg1 => "var1" }).text

  julia> Curl.put("http://requestb.in/1cvo9dy1", { :arg1 => "var1", :arg2 => "var2" }).text

  ...
</code></pre>

<h3>TODO</h3>

<ul>
<li>Curl-multi</li>
<li>Promises / callback interface</li>
</ul>

<h3>Requirements</h3>

<ul>
<li>libcurl</li>
</ul>

  </div>

</div>


  <div class="row cs-dater-panels cs-no-margin">

  <div class="col-sm-4">
    <div class="panel panel-default cs-no-margin">

      <div class="panel-heading">

        <h4 class="cs-no-margin">
          First Commit
        </h4>

      </div>

      <div class="panel-body">

        <p class="cs-no-margin cs-pull-right">
          02/23/2013
        </p>

      </div>

    </div>
  </div>

  <div class="col-sm-4">
    <div class="panel panel-default cs-no-margin">

      <div class="panel-heading">

        <h4 class="cs-no-margin">
          Last Touched
        </h4>

      </div>

      <div class="panel-body">

        <p class="cs-no-margin cs-pull-right">
          12 months ago
        </p>

      </div>

    </div>
  </div>

  <div class="col-sm-4">
    <div class="panel panel-default cs-no-margin">

      <div class="panel-heading">

        <h4 class="cs-no-margin">
          Commits
        </h4>

      </div>

      <div class="panel-body">

        <p class="cs-no-margin cs-pull-right">
          17 commits
        </p>

      </div>

    </div>
  </div>

</div>


    
<div class="row cs-require-panels cs-no-margin hidden">



    <div class="col-sm-6">

      <div class="panel panel-default cs-no-margin cs-hide-indirect-dependencies">

        <div class="panel-heading">

          <h4 class="cs-no-margin">
            Requires:
          </h4>



        </div>

        <div class="panel-body cs-no-padding">

          <div class="list-group">


              <div class="list-group-item cs-no-padding">

                <div class="row-content cs-full-width cs-category-row">

                  <a class="btn btn-default cs-full-width cs-left-align cs-no-margin">
                    No Packages
                  </a>
                </div>

              </div>




          </div>

        </div>

      </div>

    </div>



    <div class="col-sm-6">

      <div class="panel panel-default cs-no-margin cs-hide-indirect-dependencies">

        <div class="panel-heading">

          <h4 class="cs-no-margin">
            Used By:
          </h4>



        </div>

        <div class="panel-body cs-no-padding">

          <div class="list-group">


              <div class="list-group-item cs-no-padding">

                <div class="row-content cs-full-width cs-category-row">

                  <a class="btn btn-default cs-full-width cs-left-align cs-no-margin">
                    No Packages
                  </a>
                </div>

              </div>




          </div>

        </div>

      </div>

    </div>


</div>

<script>

  $(document).ready(function() {
    $(".cs-secondary-checkbox[data-toggle='tooltip']").tooltip();
  });

  $(".cs-require-panels .checkbox:not(.disabled)").click(function() {

    var includeIndirectDependencies = this.getElementsByTagName("input")[0].checked;

    if ( includeIndirectDependencies == true ) {
      this.parentElement.parentElement.classList.remove("cs-hide-indirect-dependencies");
    } else {
      this.parentElement.parentElement.classList.add("cs-hide-indirect-dependencies");
    }

  });

  $(".cs-require-panels .list-group").on('mousewheel DOMMouseScroll', function (e) {
    var e0 = e.originalEvent;
    var delta = e0.wheelDelta || -e0.detail;

    if ( delta < 0 ) { return; }

    this.scrollTop -= 30;
    e.preventDefault();
  });

</script>


  <div class="visible-xs">
    <div class="panel panel-primary cs-love-panel">

  <div class="panel-heading cs-center">
    <h4 class="cs-no-margin">Julia Observer</h4>
  </div>

  <div class="panel-body cs-no-padding">

    <div class="list-group">

      <div class="list-group-item cs-no-padding">

        <div class="row-content cs-full-width cs-category-row">

          <a href="https://github.com/djsegal/julia_observer" target="_blank" class="btn btn-default cs-full-width cs-left-align cs-no-margin">

            <h5 class="cs-center">
              made w/ <3
            </h5>

          </a>

        </div>

      </div>

    </div>

  </div>

  <div class="panel-footer cs-center cs-no-padding">

  <a href="https://github.com/djsegal/julia_observer" target="_blank" class="btn btn-default cs-side-bar-footer-link cs-full-width cs-no-margin">

    <i class="fa fa-github fa-lg"></i>

      fork us on github

  </a>

</div>


</div>

  </div>

</div>

<div class="cs-side-bar col-sm-4 hidden-xs cs-no-padding">

  <div class="panel panel-primary">

    <div class="panel-heading cs-center">

      <h4 class="cs-no-margin">Pkg.add("Curl")</h4>
    </div>

    <div class="panel-body cs-no-padding">

      <div class="list-group">

        <div class="list-group-item cs-no-padding">

          <div class="row-content cs-full-width cs-category-row">


            <a href="https://github.com/forio/Curl.jl" target="_blank" class="btn btn-default cs-full-width cs-left-align cs-no-margin">

              <h4>
                homepage
              </h4>

              <br>


              <span class="cs-pull-right cs-homepage-link">
                no homepage
              </span>

            </a>

          </div>

        </div>

        <div class="list-group-item cs-no-padding">

          <div class="row-content cs-full-width cs-category-row">

            <a class="btn btn-default cs-full-width cs-left-align cs-no-margin" href="/organizations/forio">

              <h4>
                owner
              </h4>

              <br>

              <span class="cs-pull-right">
                forio
              </span>

</a>
          </div>

        </div>

      </div>

    </div>

  </div>

  <div class="panel panel-primary">

  <div class="panel-heading cs-center">

    <h4 class="cs-no-margin">
      Activity
    </h4>

  </div>

  <div class="panel-body">

    <div id="chart-1" style="height: 20vh; width: 100%; text-align: center; color: #999; line-height: 20vh; font-size: 14px; font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif;">Loading...</div><script type="text/javascript">
  new Chartkick.AreaChart("chart-1", {"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0}, {"xtitle":"Week","ytitle":"Commits"});
</script>

  </div>

</div>


  <div class="panel panel-primary">

    <div class="panel-heading cs-center">
      <h4 class="cs-no-margin">Contributors</h4>
    </div>

    <div class="panel-body cs-no-padding">

      <div class="list-group">



          <div class="list-group-item cs-no-padding">

            <div class="row cs-contributors-list cs-no-margin">


                <div class="col-xs-3 cs-grey-image cs-no-padding">

                  <a class="btn btn-default cs-full-width cs-left-align cs-no-margin" style="background-image: url('https://avatars0.githubusercontent.com/u/1900307?v=4');" href="/users/WestleyArgentum"></a>

                </div>


                <div class="col-xs-3 cs-grey-image cs-no-padding">

                  <a class="btn btn-default cs-full-width cs-left-align cs-no-margin" style="background-image: url('https://avatars3.githubusercontent.com/u/59290?v=4');" href="/users/pauladam"></a>

                </div>


                <div class="col-xs-3 cs-grey-image cs-no-padding">

                  <a class="btn btn-default cs-full-width cs-left-align cs-no-margin" style="background-image: url('https://avatars1.githubusercontent.com/u/172643?v=4');" href="/users/stuinzuri"></a>

                </div>


                <div class="col-xs-3 cs-grey-image cs-no-padding">

                  <a class="btn btn-default cs-full-width cs-left-align cs-no-margin" style="background-image: url('https://avatars2.githubusercontent.com/u/692635?v=4');" href="/users/IainNZ"></a>

                </div>


            </div>

          </div>


      </div>

    </div>

    <div class="panel-footer cs-center cs-no-padding">
      <a class="btn btn-default cs-side-bar-footer-link cs-full-width cs-no-margin" href="/users?package_id=Curl">
        View all Contributors
</a>    </div>

  </div>

    <div class="panel panel-primary">

  <div class="panel-heading cs-center">
    <h4 class="cs-no-margin">Versions</h4>
  </div>

  <div class="panel-body cs-no-padding">

    <div class="list-group">


        <div class="list-group-item row cs-no-padding cs-no-margin">



            <div class="cs-category-row col-sm-6 cs-no-padding">

              <a href="https://github.com/forio/Curl.jl/tree/b8d68e4f38f85556ab912f6ba331b8bbc05c4cad" target="_blank" class="btn btn-default cs-full-width cs-center cs-no-margin">

                0.0.1

              </a>

            </div>



            <div class="cs-category-row col-sm-6 cs-no-padding">

              <a href="https://github.com/forio/Curl.jl/tree/918afc2a1272c125c960abe1743bfc3a9de4a027" target="_blank" class="btn btn-default cs-full-width cs-center cs-no-margin">

                0.0.2

              </a>

            </div>


        </div>


        <div class="list-group-item row cs-no-padding cs-no-margin">



            <div class="cs-category-row col-sm-6 cs-no-padding">

              <a href="https://github.com/forio/Curl.jl/tree/fd0e393f4f3b5c78f4174ccc2d62b239a8370ad4" target="_blank" class="btn btn-default cs-full-width cs-center cs-no-margin">

                0.0.3

              </a>

            </div>



            <div class="cs-category-row col-sm-6 cs-no-padding">

              <a href="https://github.com/forio/Curl.jl/tree/6d25335395e3330611d7111cb9a62064a78f7e85" target="_blank" class="btn btn-default cs-full-width cs-center cs-no-margin">

                0.0.0

              </a>

            </div>


        </div>


    </div>

  </div>

</div>


  <div class="panel panel-primary cs-love-panel">

  <div class="panel-heading cs-center">
    <h4 class="cs-no-margin">Julia Observer</h4>
  </div>

  <div class="panel-body cs-no-padding">

    <div class="list-group">

      <div class="list-group-item cs-no-padding">

        <div class="row-content cs-full-width cs-category-row">

          <a href="https://github.com/djsegal/julia_observer" target="_blank" class="btn btn-default cs-full-width cs-left-align cs-no-margin">

            <h5 class="cs-center">
              made w/ <3
            </h5>

          </a>

        </div>

      </div>

    </div>

  </div>

  <div class="panel-footer cs-center cs-no-padding">

  <a href="https://github.com/djsegal/julia_observer" target="_blank" class="btn btn-default cs-side-bar-footer-link cs-full-width cs-no-margin">

    <i class="fa fa-github fa-lg"></i>

      fork us on github

  </a>

</div>


</div>


</div>


  </body>

</html>