- Timestamp:
- 2009-10-02T21:15:44+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r2198 r2222 163 163 initAuthentication(); 164 164 try { 165 String s = sendRequest("GET", "capabilities", null,monitor );165 String s = sendRequest("GET", "capabilities", null,monitor, false); 166 166 InputSource inputSource = new InputSource(new StringReader(s)); 167 167 SAXParserFactory.newInstance().newSAXParser().parse(inputSource, new CapabilitiesParser()); … … 459 459 } 460 460 461 private String sendRequest(String requestMethod, String urlSuffix,String requestBody, ProgressMonitor monitor) throws OsmTransferException { 462 return sendRequest(requestMethod, urlSuffix, requestBody, monitor, true); 463 } 464 461 465 /** 462 466 * Generic method for sending requests to the OSM API. … … 474 478 * been exhausted), or rewrapping a Java exception. 475 479 */ 476 private String sendRequest(String requestMethod, String urlSuffix,String requestBody, ProgressMonitor monitor ) throws OsmTransferException {480 private String sendRequest(String requestMethod, String urlSuffix,String requestBody, ProgressMonitor monitor, boolean doAuthenticate) throws OsmTransferException { 477 481 StringBuffer responseBody = new StringBuffer(); 478 479 482 int retries = getMaxRetries(); 480 483 … … 486 489 activeConnection.setConnectTimeout(15000); 487 490 activeConnection.setRequestMethod(requestMethod); 488 addAuth(activeConnection); 491 if (doAuthenticate) { 492 addAuth(activeConnection); 493 } 489 494 490 495 if (requestMethod.equals("PUT") || requestMethod.equals("POST") || requestMethod.equals("DELETE")) {
Note:
See TracChangeset
for help on using the changeset viewer.