amazon web services - AWS Java SDK Error Message: The authorization header is malformed; the authorization header requires three components -


i getting following error while trying put file in aws bucket

error message: authorization header malformed; authorization header requires 3 components: credential, signedheaders, , signature. (service: amazon s3; status code: 400; error code: authorizationheadermalformed; request id: abc) http status code: 400 aws error code: authorizationheadermalformed error type: client request id: abc using following code task. idea doing wrong.

awscredentials awscredentials = new basicawscredentials("key",", "secret"); amazons3 s3client = new amazons3client(awscredentials);         s3client.setregion(com.amazonaws.regions.region.getregion(regions.us_west_2));  string key = "test"; try {      s3client.putobject(new putobjectrequest(bucketname, key, file);        } catch (amazonserviceexception ase) {           system.out.println("error message:    " + ase.getmessage());          system.out.println("http status code: " + ase.getstatuscode());          system.out.println("aws error code:   " + ase.geterrorcode());          system.out.println("error type:       " + ase.geterrortype());          system.out.println("request id:       " + ase.getrequestid());      } catch (amazonclientexception ace) {          system.out.println("caught amazonclientexception, means client encountered "                  + "a serious internal problem while trying communicate s3, "                  + "such not being able access network.");          system.out.println("error message: " + ace.getmessage());      } 


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -