© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
69 replies
KayJs

❔ What is problem?

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GenesisAPIFormApplication
{
public partial class Form1 : Form
{
private string apiUrl = "https://cluster-2.pudochu.repl.co/api/genesis";
private HttpClient httpClient = new HttpClient();

public Form1()
{
InitializeComponent();
}

private async void button1_Click(object sender, EventArgs e)
{
// Sabit bir metin kullanarak API'ye metin gönderme işlemi
string prompt = "Senin adın Jarvis. Her şeyi bilen üstün bir yapay zekasın.\n\nBen: " + "selam" + "\nJarvis:";

try
{
var content = new StringContent($"{"prompt": "{prompt}", "model": "text-dream-001"}", Encoding.UTF8, "application/json");

var response = await httpClient.PostAsync(apiUrl, content);

if (response.IsSuccessStatusCode)
{
string responseString = await response.Content.ReadAsStringAsync();
MessageBox.Show(responseString);
}
else
{
MessageBox.Show($"HTTP Hata Kodu: {response.StatusCode}");
// HTTP hata kodunu burada işleyebilirsiniz.
}
}
catch (Exception ex)
{
MessageBox.Show("İstek gönderilirken bir hata meydana geldi: " + ex.Message);
}
}
}
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ wtf? what is the problem here?
C#CC# / help
2y ago
❔ What is the problem with this code?
C#CC# / help
3y ago
❔ ✅ can anyone tell me what my problem is?
C#CC# / help
3y ago
Access is denied problem
C#CC# / help
2y ago
Next page