POSTMAN Suggested code in actual JQUERY
Options
I use POSTMAN to test REST API Queries in CS. Many of the POST operation work in POSTMAN by providing the body correctly
The file I attached is a cut and paste from my postman session. There is something that is wrong with the FormData portion as
I notice in Chrome Network traces. The call goes something like FormData[0] in valid cases it is FormData[1] but apparently the enctype is correct
as in networktrace
I found an old post here https://appworksdeveloper.opentext.com/webaccess/#url=%2Fawd%2Fforums%2Fquestions%2F11095612%2Frest%2Bapi%2Band%2Bjson
that somehow talks about this but that code also does not seem to work. I tried doing that way in a simple folder creation.
if I use SMARTUI to observe the folder create it uses QueryString parameters which are not allowed in POST when you use REST API.
I really want to create a BWS which works pretty cool when I use the SmartUI but not through Jquery code.POSTMAN has 3 code suggestion areas
JS-Fetch, JS-Jquery, JS-XHR I have used all of them to no avail.
Does anyone who has done this before see where I am going wrong?
a more informative word link here https://knowledge.opentext.com/knowledge/cs.dll?func=ll&objId=77931809&objAction=Download
Could this be because I am using a standard desktop HTML file surely that couldn't be because I can see the POST happen
The file I attached is a cut and paste from my postman session. There is something that is wrong with the FormData portion as
I notice in Chrome Network traces. The call goes something like FormData[0] in valid cases it is FormData[1] but apparently the enctype is correct
as in networktrace
I found an old post here https://appworksdeveloper.opentext.com/webaccess/#url=%2Fawd%2Fforums%2Fquestions%2F11095612%2Frest%2Bapi%2Band%2Bjson
that somehow talks about this but that code also does not seem to work. I tried doing that way in a simple folder creation.
if I use SMARTUI to observe the folder create it uses QueryString parameters which are not allowed in POST when you use REST API.
I really want to create a BWS which works pretty cool when I use the SmartUI but not through Jquery code.POSTMAN has 3 code suggestion areas
JS-Fetch, JS-Jquery, JS-XHR I have used all of them to no avail.
Does anyone who has done this before see where I am going wrong?
a more informative word link here https://knowledge.opentext.com/knowledge/cs.dll?func=ll&objId=77931809&objAction=Download
Could this be because I am using a standard desktop HTML file surely that couldn't be because I can see the POST happen
I think there is something fundamentally I am missing on Content-Type should it be application/x-www-form-urlencoded for this POST or
multipart/form-data and perhaps POSTman gets by using some kind of auto-negotiate or some cors -header stuff
multipart/form-data and perhaps POSTman gets by using some kind of auto-negotiate or some cors -header stuff
Tagged:
0
Comments
-
A big thanks to @PramodMohandas who figured out exactly what I was doing wrong.
When I used POSTMAN wrongly I created the content_type
the working solution is here
https://knowledge.opentext.com/knowledge/cs.dll/Properties/77920583
another tip is if Postman works take that cut and paste straight into a WR with a script block in header This would give Jquery. If it works in that page chances are you’ve got a pretty decent code snippet to embellish! Happy 4Th!?1
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax