Spring Boot multipart content type HTTP Request using RestTemplate

后端 未结 1 807
栀梦
栀梦 2020-12-20 02:38

I am trying to emulate this request using RestTemplate in Spring Boot

curl -X POST 
\'https://my.craftar.net/api/v0/image/?api_key=123456789abcdefghijk123456         


        
相关标签:
1条回答
  • 2020-12-20 03:27

    just add the Resource to params instead of creating a HttpEntity

    params.add("file", contentsAsResource);
    
    0 讨论(0)
提交回复
热议问题