Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Api imageshack with Java #48

@GoogleCodeExporter

Description

@GoogleCodeExporter
Hello,
Here a simple code to access REST api from imageshack, but I have always the 
same response:

{"success":true,"process_time":57,"result":{"max_filesize":25600000,"space_limit
":52428800,"space_used":1,"space_left":5242880,"passed":0,"failed":0,"total":0,"
images":[]}}

Here my code:
    WebResource resourceUpload =      client.resource("http://api.imageshack.us/v1/images");
    ObjectMapper mapper = new ObjectMapper();

    //LOGIN
    try {
      LoginDto loginDto = loginToImageshack();

      // UPLOAD
      String response = resourceUpload
      .queryParam("key", "****")
      .queryParam("url", "http://url_to_image")
      .queryParam("auth_token", loginDto.getResult().getAuth_token())
      .queryParam("format", "json")
      .accept(MediaType.APPLICATION_JSON)
      .header("Content-Type", "multipart/form-data")
      .post(String.class);

      System.out.println(response);

do you have an idea ?

Thanks for your response

Original issue reported on code.google.com by cle.ba...@gmail.com on 24 Feb 2014 at 8:29

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions