Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: btk5h/reqn
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0
Choose a base ref
...
head repository: btk5h/reqn
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 20 commits
  • 18 files changed
  • 1 contributor

Commits on Dec 4, 2016

  1. 1.1.0

    Added json encode expression and more synonyms for encode expressions
    btk5h committed Dec 4, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c1820a1 View commit details

Commits on Feb 26, 2017

  1. Copy the full SHA
    aa32020 View commit details
  2. Add support for GZIP content

    btk5h committed Feb 26, 2017
    Copy the full SHA
    217a7b2 View commit details
  3. Add support for DEFLATE content

    btk5h committed Feb 26, 2017
    Copy the full SHA
    f976923 View commit details
  4. Copy the full SHA
    3de64fb View commit details
  5. Copy the full SHA
    338a09f View commit details
  6. Fix plugin.yml

    btk5h committed Feb 26, 2017
    Copy the full SHA
    541df47 View commit details
  7. 1.2.0

    btk5h committed Feb 26, 2017
    Copy the full SHA
    ac279e8 View commit details

Commits on Mar 23, 2017

  1. Copy the full SHA
    5166a68 View commit details

Commits on May 4, 2018

  1. Copy the full SHA
    aaf52af View commit details
  2. Default to UTF-8 encoding

    btk5h committed May 4, 2018
    Copy the full SHA
    d79802b View commit details
  3. 1.2.1 Hotfix

    btk5h committed May 4, 2018
    Copy the full SHA
    ecca22a View commit details

Commits on May 20, 2018

  1. Remove colors from URLs

    btk5h committed May 20, 2018
    Copy the full SHA
    9b3724c View commit details
  2. 1.2.2 Hotfix

    btk5h committed May 20, 2018
    Copy the full SHA
    cd667be View commit details
  3. Cleanup unused code

    btk5h committed May 20, 2018
    Copy the full SHA
    ed00137 View commit details

Commits on May 26, 2018

  1. Copy the full SHA
    47a2749 View commit details
  2. 1.2.3 Hotfix

    btk5h committed May 26, 2018
    Copy the full SHA
    8071f43 View commit details

Commits on Aug 9, 2018

  1. Fix NPE when passing null urls

    btk5h committed Aug 9, 2018
    Copy the full SHA
    7e5f452 View commit details
  2. Copy the full SHA
    b2c9a4d View commit details
  3. Copy the full SHA
    845308c View commit details
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -11,8 +11,8 @@ Submits an HTTP request to the given URL. This

#### Syntax

`send [a[n]] [http] [%method%] [web] request to [the] [url] %url% [with ([the] headers
%headers% [and [the] body %body%]|[the] body %body% [and [the] headers %headers%])]`
`send [a[n]] [http] [%method%] [web] request to [the] [url] %url% [with ([the] header[s]
%headers% [and [the] body %body%]|[the] body %body% [and [the] header[s] %headers%])]`

*The last part of the syntax simply allows the header and body to be written in either order
(e.g. `with the headers and the body` or `with the body and the headers`)*
@@ -117,9 +117,9 @@ combined into a single list with no way to associate each value with its origina

#### Syntax

`[the] [response] header key[s] of %httpresponses%`
`[the] [response] header value[s] of %httpresponses%`
or
`%httpresponses%'[s] [response] header key[s]`
`%httpresponses%'[s] [response] header value[s]`

---

@@ -161,7 +161,22 @@ into a URL (e.g. when using a search api).

#### Syntax

`(http|ur(i|l)) (safe|encoded) %input%`
`(http|ur(i|l)) (safe|encoded|escaped) %input%`

#### Parameters

- `input` (type `texts`) - One or more input texts to encode.

---

### Expression `JSON Safe Text` => `text`

Converts a text into a text safe for usage in JSON strings. This can be useful for injecting user
input into a JSON payload (e.g. when using a search api).

#### Syntax

`json (safe|encoded|escaped) %input%`

#### Parameters

12 changes: 10 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -23,8 +23,10 @@
*
*/

group 'com.w00tmast3r'
version '1.0.0'
import org.apache.tools.ant.filters.ReplaceTokens

group 'com.btk5h'
version '1.2.3'

apply plugin: 'java'

@@ -43,6 +45,12 @@ repositories {
}
}

processResources {
inputs.files 'build.gradle'
from sourceSets.main.resources.srcDirs
filter(ReplaceTokens, tokens: [version: version])
}

dependencies {
compile 'org.spigotmc:spigot-api:1.11-R0.1-SNAPSHOT'
compile 'ch.njol:skript:2.2-SNAPSHOT'
Original file line number Diff line number Diff line change
@@ -23,20 +23,20 @@
*
*/

package com.w00tmast3r.reqn;
package com.btk5h.reqn;

import java.util.Map;

import static java.util.stream.Collectors.*;

public class HttpResponse {

private final int code;
private final String message;
private final String statusLine;
private final Map<String, String> headers;
private final String body;

public HttpResponse(int code, String message, String statusLine, Map<String, String> headers,
String body) {
this.code = code;
@@ -45,27 +45,27 @@ public HttpResponse(int code, String message, String statusLine, Map<String, Str
this.headers = headers;
this.body = body;
}

public int getCode() {
return code;
}

public String getMessage() {
return message;
}

public String getStatusLine() {
return statusLine;
}

public Map<String, String> getHeaders() {
return headers;
}

public String getBody() {
return body;
}

@Override
public String toString() {
return statusLine + "\n" +
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
*
*/

package com.w00tmast3r.reqn;
package com.btk5h.reqn;

import org.bukkit.plugin.java.JavaPlugin;

@@ -33,34 +33,34 @@
import ch.njol.skript.SkriptAddon;

public final class Reqn extends JavaPlugin {

private static Reqn instance;
private static SkriptAddon addonInstance;

public Reqn() {
if (instance == null) {
instance = this;
} else {
throw new IllegalStateException();
}
}

@Override
public void onEnable() {
try {
getAddonInstance().loadClasses("com.w00tmast3r.reqn", "skript");
getAddonInstance().loadClasses("com.btk5h.reqn", "skript");
} catch (IOException e) {
e.printStackTrace();
}
}

public static SkriptAddon getAddonInstance() {
if (addonInstance == null) {
addonInstance = Skript.registerAddon(getInstance());
}
return addonInstance;
}

public static Reqn getInstance() {
if (instance == null) {
throw new IllegalStateException();
Loading