Skip to content

Commit

Permalink
fixing up for new release again
Browse files Browse the repository at this point in the history
  • Loading branch information
shiffman committed Feb 26, 2016
1 parent 16f4c8a commit 50280c5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 12 deletions.
40 changes: 40 additions & 0 deletions resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Introduction
------------

HTTP Requests for Processing is a small library that takes the pain out of doing HTTP requests in Processing.

HTTP Requests for Processing is based on code by [Chris Allick](http://chrisallick.com/) and [Daniel Shiffman](http://www.shiffman.net/).


How to
------------
Install the library by [downloading the latest release](https://github.com/runemadsen/HTTProcessing/releases) or via the [Processing contribution manager](http://wiki.processing.org/w/How_to_Install_a_Contributed_Library).

Then import the library in your sketch:
```Java
import http.requests.*;
```
Then you can make GET and POST requests from your code:
```Java
GetRequest get = new GetRequest("http://httprocessing.heroku.com");
get.send();
println("Reponse Content: " + get.getContent());
println("Reponse Content-Length Header: " + get.getHeader("Content-Length"));

PostRequest post = new PostRequest("http://httprocessing.heroku.com");
post.addData("name", "Rune");
post.send();
println("Reponse Content: " + post.getContent());
println("Reponse Content-Length Header: " + post.getHeader("Content-Length"));
```
To authenticate requests using a Basic Access authentication scheme, include the following in your requests:
```Java
get.addUser("username", "password");
post.addUser("username", "password");
```
To add a header to your request, including the following:
```Java
//method: addHeader(name,value)
get.addHeader("Accept", "application/json");
post.addHeader("Content-Type", "application/json");
```
6 changes: 3 additions & 3 deletions resources/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sketchbook.location=${user.home}/Dropbox/Processing
# Uncommenting the line below will overwrite the classpath.local.location from
# above.

classpath.local.location=/Applications/Processing-3.0.1.app/Contents/Java/core/library
classpath.local.location=/Applications/Processing-3.0.1.app/Contents/Java/core/library


# Add all jar files that are required for compiling your project to the local
Expand Down Expand Up @@ -162,10 +162,10 @@ library.dependencies=?
library.keywords=?

tested.platform=osx,windows
tested.processingVersion=3.0b7
tested.processingVersion=3.0.1


# Include javadoc references into your project's javadocs.

javadoc.java.href=http://java.sun.com/javase/6/docs/api/
javadoc.java.href=http://java.sun.com/javase/7/docs/api/
javadoc.processing.href=http://processing.org/reference/javadoc/core/
21 changes: 12 additions & 9 deletions resources/build.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<project name="ProcessingLibs" default="clean" basedir="../">
<project name="Processing Library" default="clean" basedir="../">


<!--
Expand Down Expand Up @@ -52,8 +52,8 @@
<property name="project.reference" location="reference"/>
<property name="project.dist" location="distribution"/>
<property name="project.dist.version" location="distribution/${project.name}-${library.version}"/>
<property name="install.source" location="resources/install_instructions.txt"/>
<property name="install.destination" location="${project.dist.version}/INSTALL.txt"/>
<property name="install.source" location="resources/README.md"/>
<property name="install.destination" location="${project.dist.version}/README.md"/>
<property name="libprops.source" location="resources/library.properties"/>

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
Expand All @@ -78,7 +78,7 @@

<target name="init">
<echo>${line}
Building the Processing library ${project.name} ${library.version}
Building the Processing Library ${project.name} ${library.version}
${line}
src path ${project.src}
bin path ${project.bin}
Expand Down Expand Up @@ -209,8 +209,8 @@ ${line}


<target name="generate.javadoc" if="is.normal">
<!-- create the java reference of the library -->
<javadoc bottom="Processing library ${project.name} by ${author.name}. ${library.copyright}"
<!-- create the java reference of the Library -->
<javadoc bottom="Processing Library ${project.name} by ${author.name}. ${library.copyright}"
classpath="${classpath.local.location}/core.jar;{project.bin}"
destdir="${project.tmp}/${project.name}/reference"
verbose="false"
Expand Down Expand Up @@ -271,8 +271,11 @@ ${line}
<replaceregexp file="${file}" match="##library.version##" replace="${library.version}" flags="g" />
<replaceregexp file="${file}" match="##library.prettyVersion##" replace="${library.prettyVersion}" flags="g" />

<replaceregexp file="${file}" match="##compatible.minRevision##" replace="${compatible.minRevision}" flags="g" />
<replaceregexp file="${file}" match="##compatible.maxRevision##" replace="${compatible.maxRevision}" flags="g" />

<replaceregexp file="${file}" match="##library.url##" replace="${library.url}" flags="g" />
<replaceregexp file="${file}" match="##library.category##" replace="${library.category}" flags="g" />
<replaceregexp file="${file}" match="##library.categories##" replace="${library.categories}" flags="g" />
<replaceregexp file="${file}" match="##library.sentence##" replace="${library.sentence}" flags="g" />
<replaceregexp file="${file}" match="##library.paragraph##" replace="${library.paragraph}" flags="g" />
<replaceregexp file="${file}" match="##library.keywords##" replace="${library.keywords}" flags="g" />
Expand All @@ -289,15 +292,15 @@ ${line}


<target name="generate.install.library" if="is.normal">
<copy file="${install.source}" tofile="${project.dist.version}/INSTALL.txt" />
<copy file="${install.source}" tofile="${install.destination}" />

<antcall target="parse.file"><param name="file" value="${install.destination}"/></antcall>
</target>



<target name="generate.zip" if="is.normal">
<!-- zip the distribution of the library -->
<!-- zip the distribution of the Library -->

<move todir="${project.dist.version}/tmp/${project.name}">
<fileset dir="${project.dist.version}/${project.name}" />
Expand Down

0 comments on commit 50280c5

Please sign in to comment.