SUBJECT: RESTful API Interaction, posting files to a server with creds.
I have basic authentication and communication working with the server that I want to post a file to.
I have had good success communicating with this particular server using MIT AI2.
I can use Postman successfully to post files, using the code generated below, so I know the server side is working.
We just have to make AI2 look like that CURL, yes?
In Postman I set this KEY explicitly in the BODY
1) Review API documentation
2) Get it working in Postman
3) Port it to MIT AI2
When that translates to MIT AI2, I do the following:
1) I manually build Params from the base URL and whatever the RESTful API wants... Authentication information usually.
2) I use the AI2 built in functions to build up the Header
3) I am trying to figure out how to set up the BODY, other than using the pre-baked function which takes a file path input.
I am an experienced developer but I am choppy around RESTful api. I have done it many times, but a few years always goes by between using the skill set and much rust grows.
I have done significant debugging to ensure:
* Base URL is correct
* Params are correct (identical to CURL - the parse from JSON, from previous API hit, comes out as expected and intended)
* In my header I am only calling out content type, where as postaman includes something called "boundary".. I do not know what that is and I am not including it.
* In my body, I am dependent on pre-built AI2 codes. . . so I have not added the key word fileUpload
I did notice while building my query at Postman that I had to explicitly call out the KEY value for the file transfer. . .
Anyone want to give me some ideas for troubleshooting?
Sorry I had to scribble some things out. Many protect their API with Security thru Obscurity. Usually I criticize this form of security, but in this case, obscurity really does slow down the adversary.