Examples of HttpHeaders


Examples of org.springframework.http.HttpHeaders

     * @throws ZencoderClientException
     */
    public ZencoderAllUsage getUsageForVodAndLive(Date from, Date to, String grouping) throws ZencoderClientException {
        String url = api_url + "/reports/all" + createUsageQueryArgString(from, to, grouping);

        HttpHeaders headers = getHeaders();
        @SuppressWarnings("rawtypes")
        HttpEntity entity = new HttpEntity<String>("", headers);

        ResponseEntity<String> response = null;
        try {
View Full Code Here

Examples of org.springframework.http.HttpHeaders

         
          if (!(shpFile && shxFile && dbfFile)){
            logger.error("Not all necessary files are present.");
            throw new Exception("Not all necesary files are present.");
          }
          HttpHeaders headers = new HttpHeaders();
          headers.setContentType(MediaType.MULTIPART_FORM_DATA);
          //headers.setContentType(MediaType.parseMediaType("multipart/form-data;charset=utf-8"));
         
         
          List<Charset> charSets = new ArrayList<Charset>();
          charSets.add(Charset.forName("UTF-8"));
          headers.setAcceptCharset(charSets);
          HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<MultiValueMap<String, Object>>(map, headers);

          /*try {
            while(true){
              Thread.sleep(500);
View Full Code Here

Examples of org.springframework.http.HttpHeaders

  @RequestMapping(method = RequestMethod.POST, consumes = {"application/json"})
  @ResponseStatus(HttpStatus.CREATED)
  public HttpEntity<?> create(@RequestBody Book book, @Value("#{request.requestURL}") StringBuffer parentUri) {
    book = this.bookRepository.save(book);
    HttpHeaders headers = new HttpHeaders();
    headers.setLocation(childLocation(parentUri, book.getId()));
    return new HttpEntity<Object>(headers);
  }
View Full Code Here

Examples of org.springframework.http.HttpHeaders

  }
 
  @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
  public @ResponseBody ResponseEntity<Object> deleteMovie(@PathVariable UUID id) {
    movieService.deleteMovie(id);
    HttpHeaders headers = new HttpHeaders();
    headers.set("Access-Control-Allow-Origin", "*");
    return new ResponseEntity<Object>(null, headers, HttpStatus.NO_CONTENT);
  }
View Full Code Here

Examples of org.springframework.http.HttpHeaders

    movie.getComments().add(new Comment(new Date(), content));
    return enableCorsRequests(movieResourceAssembler.toResource(movie), HttpStatus.CREATED);
  }
 
  private <T> ResponseEntity<T> enableCorsRequests(T entity, HttpStatus statusCode) {
    HttpHeaders headers = new HttpHeaders();
    headers.set("Access-Control-Allow-Origin", "*");
    return new ResponseEntity<T>(entity, headers, statusCode);
  }
View Full Code Here

Examples of org.springframework.http.HttpHeaders

    Map<String, Object> extraProperties = request.getExtraProperties();

    delegate.createCluster(request.getClusterId(), request.getClusterDef(), projectionData, extraProperties);

    HttpHeaders responseHeaders = new HttpHeaders();
    UriComponents uriComponents = MvcUriComponentsBuilder
          .fromMethodCall(on(YarnContainerClusterMvcEndpoint.class).clusterInfo(request.getClusterId())).build();
    responseHeaders.setLocation(uriComponents.toUri());

    return new ResponseEntity<Void>(responseHeaders, HttpStatus.CREATED);
  }
View Full Code Here

Examples of org.springframework.http.HttpHeaders

  }

  @Override
  public DriveFile upload(Resource resource, DriveFile metadata, UploadParameters parameters) {
   
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MULTIPART_FORM_DATA);
   
    MultiValueMap<String, Object> body = new LinkedMultiValueMap<String, Object>();
    body.add("metadata", metadata);
    body.add("file", resource);
   
View Full Code Here

Examples of org.springframework.http.HttpHeaders

  }

  @Override
  @SuppressWarnings({ "unchecked", "rawtypes" })
  protected AccessGrant postForAccessGrant(String accessTokenUrl, MultiValueMap<String, String> parameters) {
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
    HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(parameters, headers);
    ResponseEntity<Map> responseEntity = getRestTemplate().exchange(accessTokenUrl, HttpMethod.POST, requestEntity, Map.class);
    Map<String, Object> responseMap = responseEntity.getBody();
    return extractAccessGrant(responseMap);
  }
View Full Code Here

Examples of org.springframework.http.HttpHeaders

    Resource s2logo = new ClassPathResource(resourcePath);
    MultiValueMap<String, Object> multipartMap = new LinkedMultiValueMap<String, Object>();
    multipartMap.add("company", "SpringSource");
    multipartMap.add("company-logo", s2logo);
    logger.info("Created multipart request: " + multipartMap);
    HttpHeaders headers = new HttpHeaders();
    headers.setContentType(new MediaType("multipart", "form-data"));
    HttpEntity<Object> request = new HttpEntity<Object>(multipartMap, headers);
    logger.info("Posting request to: " + uri);
    ResponseEntity<?> httpResponse = template.exchange(uri, HttpMethod.POST, request, Object.class);
    if (!httpResponse.getStatusCode().equals(HttpStatus.OK)){
      logger.error("Problems with the request. Http status: " + httpResponse.getStatusCode());
View Full Code Here

Examples of pygmy.core.HttpHeaders

    int articleNumber;
    HttpHeaders headers;
    String body;

    public Article( NntpInputStream stream ) throws IOException {
        headers = new HttpHeaders( stream );
        body = stream.readText();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.