cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to send a file , not an attachment, using REST API call, the api accepts a filestream object

SOLVED
Highlighted
New Contributor

Trying to send a file , not an attachment, using REST API call, the api accepts a filestream object

The File is PDF file, Programatically the Body wil look like this 


body = [file:FileObj, name:'file']

 

The test step looks like this [Soap help 1.png]

 

The same step in postman can be done as this[Soap help 2.png]

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Trying to send a file , not an attachment, using REST API call, the api accepts a filestream obj

Hi @Joydeep,

I had a similar issue about 6 months ago where i use the form-data type in Postman and used the equivalent in ReadyAPI! and i remember it being quite fiddly to get it to work.

I'll have to dig the post i submitted out, but in the meantime if you look at your screenshots, we cant actually determine anything from the detail youve provided which could help diagnose the issue.

Consider the postman pic....youve blanked the full URI, not just the server. We would need to know all the uri/template and query parameters as well as headers before we could really help. From a security perspective as long as you dont supply the auth details along with the servername....thats all you need to hide, but (depending on the issue and especially this formdata issue) we'd need to understand the full URI (so full URL excepting the server).

Whilst i find the post (that explains what i was doing wrong) i raised and until you give us a bit more info, i think i remember setting up the formdata parms as query parms in ReadyAPI! and i think i used the 'Post Querystring' checkbox.....but i'm stretching my memory a bit here!

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

2 REPLIES 2
Highlighted
Community Hero

Re: Trying to send a file , not an attachment, using REST API call, the api accepts a filestream obj

Hi @Joydeep,

I had a similar issue about 6 months ago where i use the form-data type in Postman and used the equivalent in ReadyAPI! and i remember it being quite fiddly to get it to work.

I'll have to dig the post i submitted out, but in the meantime if you look at your screenshots, we cant actually determine anything from the detail youve provided which could help diagnose the issue.

Consider the postman pic....youve blanked the full URI, not just the server. We would need to know all the uri/template and query parameters as well as headers before we could really help. From a security perspective as long as you dont supply the auth details along with the servername....thats all you need to hide, but (depending on the issue and especially this formdata issue) we'd need to understand the full URI (so full URL excepting the server).

Whilst i find the post (that explains what i was doing wrong) i raised and until you give us a bit more info, i think i remember setting up the formdata parms as query parms in ReadyAPI! and i think i used the 'Post Querystring' checkbox.....but i'm stretching my memory a bit here!

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

Highlighted
New Contributor

Re: Trying to send a file , not an attachment, using REST API call, the api accepts a filestream obj

This worked, all the parameters were not in sync

 

New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Compete with community members in the TechCorner Challenge and get into the Leaderboard!

Rank Participant Points Earned
1 msiadak 12
2 nmrao 8
3 HimanshuTayal 3
Top Kudoed Authors