You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebService is expecting a file attachment in the Rest message but I am getting below error from web service :
Response is {"id":null,"code":"error.invalid.file.format","errors":["File is claiming to be content-type: image/jpeg but is not properly formatted."],"args":["image/jpeg"]}
Can you please help on how to properly attach image in Rest Message. Above mentioned Rest message works fine in PostMan but it is not working when I am using it from Eclipse.
Thanks in Advance.
The text was updated successfully, but these errors were encountered:
Hi Team,
I am using Unirest libraries to create Rest based message in Eclipse using java language. The code I have used is below (got from PostMan):
HttpResponse response = Unirest.post("XXXXXX")
.header("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
.header("Authorization", "Bearer XXXXXX")
.header("Cache-Control", "no-cache")
.body("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name="stringPart"\r\n\r\n{"AAAA":[{"BBBB":"passphrase","fileName": "check.wav", "bioType":60, "captureSequence":"CCCC"}] }\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name="check.wav"; filename="Sagar.jpeg"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--")
.asString();
WebService is expecting a file attachment in the Rest message but I am getting below error from web service :
Response is {"id":null,"code":"error.invalid.file.format","errors":["File is claiming to be content-type: image/jpeg but is not properly formatted."],"args":["image/jpeg"]}
Can you please help on how to properly attach image in Rest Message. Above mentioned Rest message works fine in PostMan but it is not working when I am using it from Eclipse.
Thanks in Advance.
The text was updated successfully, but these errors were encountered: