mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Create a nomulus "curl" command
Create a command to send arbitrary, authenticated HTTP requests to the backend and remove the existing commands that are basically just wrappers around this. Tested: In addition to the unit tests, verified both get and post requests against alpha. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=207756509
This commit is contained in:
parent
6810e959f9
commit
e3977024f3
9 changed files with 223 additions and 284 deletions
|
@ -18,6 +18,7 @@ import com.google.common.net.MediaType;
|
|||
import google.registry.tools.Command.RemoteApiCommand;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/** A command that executes on the server. */
|
||||
interface ServerSideCommand extends RemoteApiCommand {
|
||||
|
@ -27,9 +28,13 @@ interface ServerSideCommand extends RemoteApiCommand {
|
|||
|
||||
void prefetchXsrfToken();
|
||||
|
||||
String send(String endpoint, Map<String, ?> params, MediaType contentType, byte[] payload)
|
||||
/** Send a POST request. TODO(mmuller): change to sendPostRequest() */
|
||||
String send(
|
||||
String endpoint, Map<String, ?> params, MediaType contentType, @Nullable byte[] payload)
|
||||
throws IOException;
|
||||
|
||||
String sendGetRequest(String endpoint, Map<String, ?> params) throws IOException;
|
||||
|
||||
Map<String, Object> sendJson(String endpoint, Map<String, ?> object) throws IOException;
|
||||
|
||||
String getServerUrl();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue