List of usage examples for org.springframework.http MediaType APPLICATION_XML
MediaType APPLICATION_XML
To view the source code for org.springframework.http MediaType APPLICATION_XML.
Click Source Link
From source file:demo.Converters.java
public static List<ClientHttpRequestInterceptor> getInterceptors() { return Arrays.<ClientHttpRequestInterceptor>asList(new AcceptHeaderInterceptor(MediaType.APPLICATION_XML)); }
From source file:com.cisco.cta.taxii.adapter.httpclient.HttpHeadersAppender.java
public void appendTo(HttpHeaders headers) { headers.setContentType(MediaType.APPLICATION_XML); headers.setAccept(ImmutableList.of(MediaType.APPLICATION_XML)); headers.set("X-Taxii-Accept", "urn:taxii.mitre.org:message:xml:1.1"); headers.set("X-TAXII-Content-Type", "urn:taxii.mitre.org:message:xml:1.1"); headers.set("X-Taxii-Protocol", "urn:taxii.mitre.org:protocol:https:1.0"); headers.set("X-TAXII-Services", "urn:taxii.mitre.org:services:1.1"); headers.set("User-Agent", "taxii-log-adapter-" + Version.getImplVersion()); }
From source file:com.wavemaker.commons.util.WMUtils.java
public static boolean isXmlMediaType(MediaType mediaType) { return MediaType.APPLICATION_XML.equals(mediaType) || MediaType.TEXT_XML.equals(mediaType) || MediaType.APPLICATION_ATOM_XML.equals(mediaType); }
From source file:nl.iwelcome.connector.google.XmlMessageConverter.java
@Override public List<MediaType> getSupportedMediaTypes() { return Arrays.asList(MediaType.APPLICATION_XML); }
From source file:com.mentat.rest.web.WebConfiguration.java
/** * Setup a simple strategy: use all the defaults and return XML by default when not sure. *///www.ja va 2 s . c o m @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { // configurer.favorPathExtension(false). // favorParameter(false). // parameterName("mediaType"). // ignoreAcceptHeader(false). // useJaf(false). // defaultContentType(MediaType.APPLICATION_JSON). // mediaType("xml", MediaType.APPLICATION_XML). // mediaType("json", MediaType.APPLICATION_JSON); configurer.defaultContentType(MediaType.APPLICATION_XML); }
From source file:com.torchmind.stockpile.server.configuration.WebMvcConfiguration.java
/** * {@inheritDoc}// w w w . j av a 2 s. co m */ @Override public void configureContentNegotiation(@Nonnull ContentNegotiationConfigurer configurer) { configurer.defaultContentType(MediaType.APPLICATION_JSON_UTF8); configurer.mediaType("json", MediaType.APPLICATION_JSON_UTF8); configurer.mediaType("xml", MediaType.APPLICATION_XML); configurer.favorPathExtension(true); configurer.ignoreUnknownPathExtensions(true); configurer.ignoreAcceptHeader(false); }
From source file:biz.c24.io.spring.http.C24HttpMessageConverterUnitTests.java
@Test public void canConvertClassIfMediaTypeMatches() { assertThat(converter.canRead(CustomerLocal.class, MediaType.APPLICATION_XML), is(true)); }
From source file:org.projecthdata.social.api.impl.HDataTemplateTest.java
@Test public void test() { HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.setContentType(MediaType.APPLICATION_XML); mockServer.expect(requestTo("http://hstore.com/1234/root.xml")).andExpect(method(GET)).andRespond( withResponse(new ClassPathResource("../../resources/root.xml", getClass()), responseHeaders)); Root root = hDataTemplate.getRootOperations().getRoot(); assertEquals(5, root.getExtensions().size()); }
From source file:example.xmlbeam.XmlBeamExampleTests.java
private static MockHttpServletRequestBuilder buildXmlPostRequestFor(String filename) throws Exception { Path path = Paths.get(new ClassPathResource(filename, XmlBeamExampleTests.class).getURI()); return post("/customers").// content(Files.readAllBytes(path)).// contentType(MediaType.APPLICATION_XML); }
From source file:org.oncoblocks.centromere.web.util.ApiMediaTypes.java
public static List<MediaType> getXmlMediaTypes() { return Arrays.asList(MediaType.APPLICATION_XML, APPLICATION_HAL_XML); }