Created
January 23, 2023 01:03
-
-
Save prodigysml/d92ee3364907937d66ce04f432186f92 to your computer and use it in GitHub Desktop.
Bugcrowd Mystique Hint #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Test { | |
... | |
//...... generate registration payload | |
//String payload = String.format("{\"username\":\"new_user\",\"publicKey\":\"%s\"}", encodedpubkey); | |
String payload = String.format("{\"username\":\"new_user\",\"publicKey\":\"%s\"}", encodedpubkey); | |
//...... register user | |
var uri = URI.create("http://127.0.0.1:3000/register"); | |
var client = HttpClient.newHttpClient(); | |
HttpRequest request = HttpRequest.newBuilder() | |
.uri(uri) | |
//.POST(HttpRequest.BodyPublishers.ofString(payload)) | |
.POST(HttpRequest.BodyPublishers.ofString(payload)) | |
.headers("Content-Type", "application/json") | |
.build(); | |
try { | |
var response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); | |
System.out.println(response.statusCode()); | |
System.out.println(response.body()); | |
} catch (IOException ex) { | |
} catch (InterruptedException ex) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment