ZombieLink

A lightweight HTTP facade which simplifies network communication.

License

License

GroupId

GroupId

com.lonepulse
ArtifactId

ArtifactId

zombielink
Last Version

Last Version

1.3.3
Release Date

Release Date

Type

Type

jar
Description

Description

ZombieLink
A lightweight HTTP facade which simplifies network communication.

Download zombielink

How to add to project

<!-- https://jarcasting.com/artifacts/com.lonepulse/zombielink/ -->
<dependency>
    <groupId>com.lonepulse</groupId>
    <artifactId>zombielink</artifactId>
    <version>1.3.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.lonepulse/zombielink/
implementation 'com.lonepulse:zombielink:1.3.3'
// https://jarcasting.com/artifacts/com.lonepulse/zombielink/
implementation ("com.lonepulse:zombielink:1.3.3")
'com.lonepulse:zombielink:jar:1.3.3'
<dependency org="com.lonepulse" name="zombielink" rev="1.3.3">
  <artifact name="zombielink" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.lonepulse', module='zombielink', version='1.3.3')
)
libraryDependencies += "com.lonepulse" % "zombielink" % "1.3.3"
[com.lonepulse/zombielink "1.3.3"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.httpcomponents : httpcore jar 4.2.3
org.apache.httpcomponents : httpclient jar 4.2.3

test (4)

Group / Artifact Type Version
com.google.code.gson : gson jar 2.2.4
org.simpleframework : simple-xml jar 2.7.1
junit : junit jar 4.11
com.github.tomakehurst : wiremock jar 1.33

Project Modules

There are no modules declared in this project.
      ZombieLink   /zŏm'bē'lĭngk/   noun.

1. A lightweight HTTP facade which simplifies network communication.   2. Accepts an interface which describes the remote service and gives you an implementation of it.

Build Status   Coverage Status
zombielink-1.3.3.jar

##Overview

Here's your model.

public class Repo {

    private String id;
    private String name;
    private boolean fork;
    private int stargazers_count;
    
    ...
}

Define the endpoint.
@Deserialize(JSON)
@Endpoint("https://api.github.com")
public interface GitHubEndpoint {

    @GET("/users/{user}/repos")
    List<Repo> getRepos(@PathParam("user") String user);
}

Looks for Gson on your build path.


Inject and invoke.
@Bite
private GitHubEndpoint endpoint;   

{
    Zombie.infect(this);
}

...

List<Repo> repos = endpoint.getRepos("sahan");

Create as many endpoints as you want...
@Endpoint("http://example.com")
public interface ExampleEndpoint {

    @Serialize(XML) 
    @PUT("/content")
    void putContent(@Entity Content content);
}

Looks for Simple-XML on your build path.


...and inject 'em all.
@Bite
private GitHubEndpoint gitHubEndpoint;

@Bite
private ExampleEndpoint exampleEndpoint;

{
    Zombie.infect(this);
}

##Setup > If you opt to use the out-of-the-box JSON (de)serializer add the [Gson](http://code.google.com/p/google-gson) dependency; like wise add the [Simple-XML](http://simple.sourceforge.net) dependency for the XML (de)serializer.
### 1. For Maven based projects.

Add the following dependency to project's pom.xml file.

<dependency>
   <groupId>com.lonepulse</groupId>
   <artifactId>zombielink</artifactId>
   <version>1.3.3</version>
</dependency>

### 2. For Gradle based projects.

Add the following repository and dependency to your project's build.gradle file.

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.lonepulse:zombielink:1.3.3'
}

### 3. Add the JAR to your build path manually.

Download the ZombieLink-1.3.3.jar and add it to your libs folder.

Note that Gson is required for JSON (de)serialization and Simple-XML is required for XML (de)serialization.


##Wiki

Coding with ZombieLink is a breeze. It follows a simple annotation based coding style and adheres to a minimal intrusion policy. Kickoff with the quickstart and follow the rest of the wiki pages.

  1. Quickstart

  2. Defining, Injecting and Invoking

  3. Identifying HTTP Methods

  4. Sending Query and Form Parameters

  5. Sending a Request Body

  6. Serializing Request Content

  7. Receiving a Response Body

  8. Deserializing Response Content

  9. Sending and Receiving Headers

  10. Executing Requests Asynchronously

  11. Creating Stateful Endpoints

  12. Intercepting Requests

  13. Overriding, Detaching and Skipping Components

  14. Wiring and Injecting Endpoints

  15. Configuring ZombieLink

##License This library is licensed under Apache License, Version 2.0.

Versions

Version
1.3.3
1.3.2
1.3.1
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0