Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feat. Request: HttpRequest/HttpResponse convenience methods.

Aperta
#664 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sylvesterkaczmarek ci sta già lavorando.

Dal 21/8/2026.

  • #923 di @sylvesterkaczmarek — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java, kotlin
Ambito
api

Direzione di ricerca

Individua le definizioni di HttpHeaders, HttpRequestBody e HttpResponseBody, quindi esamina le API esistenti names(), values() e writeTo(OutputStream). Il lavoro è completato quando viene fornito un accesso ergonomico agli header e a InputStream per i body delle request e delle response, preservando il comportamento esistente; l’issue non indica test o file specifici da eseguire.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement sdk

Description

In order to implement the HttpClient interface in Java to embed a custom HttpClient in the SDK, there is the need to implement some ellaborate mapping for a few entities in the HttpRequest/HttpResponse.

1. Headers

Currently one can iterate through names and then get a List<String> for each. This results in code that looks like this:

HttpHeaders target = new HttpHeaders();
sourceHeaders.names().forEach(name -> {
    List<String> values = sourceHeaders.values(name);
    HttpHeaderName headerName = HttpHeaderName.fromString(name);
    if (values.isEmpty()) {
        target.set(headerName, "");
    } else {
        target.set(headerName, values);
    }
});
return target;

It would be nice to have something that returns the Headers as Map<String, String> or even Map<String, List<String>>

2. HttpResponseBody

Given the API, one has to "double read" the content of the body by calling fun writeTo(outputStream: OutputStream)

It would be nice to have an alternative that would return an java.io.InputStream so we can pipe the body directly to our type.

3. HttpRequestBody

Same as the above. Having the contents of the body returned as an InputStream would make things more ergonomic for us.

Thank you!

Lingua principale
Kotlin
Stelle
1.5k
Fork
266
Merge medio
9h 50m
PR unite (30g)
146

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openai/openai-java

Tutte le issue di openai/openai-java

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.