Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

288
Views
Solicitud PUT (JAVA) con HttpUrlConnection

Estoy tratando de hacer una solicitud "PUT" con Android Studio. Pero, en realidad, no funciona, recibí un "404 no encontrado" cuando obtuve toda la información necesaria.


URL de cadena = " https://[...] ";

 URL obj = null; try { obj = new URL(url); } catch (MalformedURLException e) { e.printStackTrace(); } HttpURLConnection con = null; DataOutputStream dataOutputStream = null; try { con = (HttpURLConnection) obj.openConnection(); } catch (IOException e) { e.printStackTrace(); } // optional default is GET try { con.setRequestMethod("PUT"); con.setDoInput(true); con.setDoOutput(true); System.out.println("Info User to update : " + params[0]); con.setRequestProperty("X-Auth-Token", params[0].get("token")); [...] con.setRequestProperty("shop_id", params[1].get("id")); dataOutputStream = new DataOutputStream(con.getOutputStream()); OutputStreamWriter osw = new OutputStreamWriter(con.getOutputStream()); osw.flush(); osw.close(); } catch (ProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (dataOutputStream != null) { try { dataOutputStream.flush(); dataOutputStream.close(); } catch (IOException exception) { exception.printStackTrace(); } } } int responseCode = 0; try { responseCode = con.getResponseCode(); } catch (IOException e) { e.printStackTrace(); }

Si pruebo la solicitud en Symfony (aplicación web), funciona bien, pero con el código ya no... ¿Ves algún problema con mi solicitud?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Problema resuelto, pude hacer lo que quería usando una solicitud PATCH en su lugar.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!