Skip to content

Commit 27c8d2b

Browse files
author
Gabriela Achim
committed
Updated default protocol to HTTPS.
1 parent ad70ceb commit 27c8d2b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
nameapi-client-java
22
===================
33

4-
Java Client for the NameAPI Web Service at http://www.nameapi.org/
4+
Java Client for the NameAPI Web Service at https://www.nameapi.org
55

66
There are functional tests (in test/functional) that demonstrate how to use this library.
77

@@ -46,8 +46,7 @@ Mode mode = NameApiModeFactory.withContext(
4646
"your-api-key",
4747
context,
4848
//the default and live server is "api.nameapi.org"
49-
//we're using the latest release candidate with latest features here:
50-
new Host("rc50-api.nameapi.org", 80), NameApiPortUrlFactory.versionLatestStable()
49+
new Host("api.nameapi.org", Protocol.HTTPS), NameApiPortUrlFactory.version5_3())
5150
);
5251
```
5352

src/main/java/org/nameapi/client/lib/NameApiModeFactory.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.optimaize.anythingworks.client.rest.RestKeys;
55
import com.optimaize.anythingworks.client.rest.RestPortUrlFactory;
66
import com.optimaize.anythingworks.common.host.Host;
7+
import com.optimaize.anythingworks.common.host.Protocol;
78
import com.optimaize.command4j.Mode;
89
import org.jetbrains.annotations.NotNull;
910
import org.nameapi.ontology5.input.context.Context;
@@ -15,7 +16,7 @@
1516
*/
1617
public class NameApiModeFactory {
1718

18-
private static final Host DEFAULT_HOST = new Host("api.nameapi.org", 80);
19+
private static final Host DEFAULT_HOST = new Host("api.nameapi.org", Protocol.HTTPS);
1920
private static final NameApiPortUrlFactory DEFAULT_PORT_FACTORY = NameApiPortUrlFactory.versionLatestStable();
2021

2122

@@ -25,7 +26,7 @@ public class NameApiModeFactory {
2526
* <p>Example: .with(StdoutLoggingExtension.enabled())</p>
2627
*
2728
* @param apiKey Your personal api key from registering with us.
28-
* @param host for example {@code new Host("api.nameapi.org", 80)}
29+
* @param host for example {@code new Host("api.nameapi.org", Protocol.HTTPS)}
2930
* @param portUrlFactory for example {@code NameApiPortUrlFactory.versionLatestStable()}
3031
*/
3132
@NotNull
@@ -39,7 +40,7 @@ public static Mode minimal(@NotNull String apiKey, @NotNull Host host, @NotNull
3940

4041
/**
4142
* Overloaded method that uses
42-
* for host: {@code new Host("api.nameapi.org", 80)}
43+
* for host: {@code new Host("api.nameapi.org", Protocol.HTTPS)}
4344
* for port url: {@code NameApiPortUrlFactory.versionLatestStable()}
4445
*/
4546
@NotNull
@@ -55,7 +56,7 @@ public static Mode minimal(@NotNull String apiKey) {
5556
*
5657
* @param apiKey Your personal api key from registering with us.
5758
* @param context for example {@code new ContextBuilder().priority(Priority.REALTIME).build()}
58-
* @param host for example {@code new Host("api.nameapi.org", 80)}
59+
* @param host for example {@code new Host("api.nameapi.org", Protocol.HTTPS)}
5960
* @param portUrlFactory for example {@code NameApiPortUrlFactory.versionLatestStable()}
6061
*/
6162
@NotNull
@@ -65,8 +66,8 @@ public static Mode withContext(@NotNull String apiKey, @NotNull Context context,
6566
}
6667

6768
/**
68-
* Overloaded method that uses
69-
* for host: {@code new Host("api.nameapi.org", 80)}
69+
* Overloaded method that uses:
70+
* for host: {@code new Host("api.nameapi.org", Protocol.HTTPS)}
7071
* for port url: {@code NameApiPortUrlFactory.versionLatestStable()}
7172
*/
7273
@NotNull

0 commit comments

Comments
 (0)