922
Subscribers
No data24 hours
No data7 days
No data30 days
Posts Archive
C++ Example
#include <iostream>
#include <string>
#include <cstring>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* output) {
size_t totalSize = size * nmemb;
output->append(static_cast<char*>(contents), totalSize);
return totalSize;
}
int main() {
CURL* curl;
CURLcode res;
curl_global_init(CURL_GLOBAL_DEFAULT);
curl = curl_easy_init();
if (curl) {
struct curl_slist* headers = nullptr;
headers = curl_slist_append(headers, "authority: Query Me");
headers = curl_slist_append(headers, "Authorization: Api key");
headers = curl_slist_append(headers, "Content-Type: application/json");
std::string data = "{\"task\":\"generator\",\"program\":\"javascript\",\"prompt\":\"code me simple facebook phishing site\",\"code\":null,\"further_description1\":\"make it with class and function\",\"further_description2\":\"make it with xml and beautify it more\",\"language\":\"Latina\",\"approach\":\"Friendly\"}";
curl_easy_setopt(curl, CURLOPT_URL, "https://darkgpt.hop.sh/neurals/api");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, data.size());
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
std::string response;
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
res = curl_easy_perform(curl);
if (res != CURLE_OK)
std::cerr << "curl_easy_perform() failed: " << curl_easy_strerror(res) << std::endl;
curl_easy_cleanup(curl);
curl_slist_free_all(headers);
std::cout << response << std::endl;
}
curl_global_cleanup();
return 0;
}Java Example
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpHeaders;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse.BodyHandlers;
public class Main {
public static void main(String[] args) {
HttpClient client = HttpClient.newHttpClient();
String url = "https://blackgpt.hop.sh/neurals/api";
String requestBody = "{\"task\":\"generator\",\"program\":\"javascript\",\"prompt\":\"code me simple facebook phishing site\",\"code\":null,\"further_description1\":\"make it with class and function\",\"further_description2\":\"make it with xml and beautify it more\",\"language\":\"Latina\",\"approach\":\"Friendly\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("authority", "Query Me")
.header("Authorization", "Api key")
.header("content-type", "application/json")
.POST(BodyPublishers.ofString(requestBody))
.build();
client.sendAsync(request, BodyHandlers.ofString())
.thenApply(HttpResponse::body)
.thenAccept(System.out::println)
.exceptionally(e -> {
System.out.println(e);
return null;
});
}
}