Im trying to integrate a model with a WMS system. Communication is via http using post/get. In this case im trying a simple request that will return a lot information about the item being queried.
This is the call copied from postman that im trying to replicated from flexsim
POST //abcd/api/dcinventory/ilpn/ilpninventorysearch HTTP/1.1 Host: xyz.com Content-Type: application/json Authorization: bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyT3JncyI6WyJESy1UQVUiXSwidXNlcl9uYW1lIjoiREstVEFVLUFETUlOVVNFUiIsInVzZXJMb2NhdGlvbnMiOlt7ImxvY2F0aW9uSWQiOiJESy1UQVUiLCJsb2NhdGlvblR5cGUiOiJkdW1teSJ9XSwibG9jYWxlIjoiZW4iLCJleGNsdWRlZFVzZXJCdXNpbmVzc1VuaXRzIjpbXSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIiwiUk9MRV9hZG1pbkBESy1UQVUiXSwiY2xpZW50X2lkIjoib21uaWNvbXBvbmVudC4xLjAuMCIsInVzZXJUaW1lWm9uZSI6IkV1cm9wZS9Db3BlbmhhZ2VuIiwiZWRnZSI6MCwic2NvcGUiOlsib21uaSIsImNvbXBvbmVudCJdLCJvcmdhbml6YXRpb24iOiJESy1UQVUiLCJhY2Nlc3N0b0FsbEJVcyI6ZmFsc2UsInRlbmFudElkIjoidWJ0c3NkZjExcCIsImV4cCI6MTY0Nzk4MjQyOSwidXNlckRlZmF1bHRzIjpbXSwianRpIjoiMWRhNmU3OTMtZTI4ZC00ZWVmLWIwYzctMWExM2E1Y2MxMTlhIiwidXNlckJ1c2luZXNzVW5pdHMiOltdfQ.b14AdIXNQfaC1jNxg1VW3kZSz-QnpqMJIInxktnXNiPCFOZfHn3A54rT8UcPcubOdGaUS43de869yQA_QcS7JE2xalwO6USqhHMfxj80ZPO6alvPUn0k4nDSErLf6LqJaACDuds95oYpELJPa1ULkw69AnHbqeP5rXcF3oIzubbMceLpzwSrUgO4wgbSeifRkIUhA8NNGiSJN36JMU127FbCZ7xlo6ZcUDgx3IlycyoMYgt268hSmKt18tXnCNn1W9dkMCkS3V1U9S7i7S1ETZfzrKoOqoIoGU2Li3WlNe_RfOus-G_SnbPOQcxhOjODZafdzOZU_fNJJHrnsq_d_g SelectedLocation: aaaa SelectedOrganization: aaaa Content-Length: 49 { "Query" : "IlpnId = 0015700000000500CB60" }
This is who I tried so far.
/**Custom Code*/ Object current = param(1); treenode activity = param(2); Token token = param(3); treenode processFlow = ownerobject(activity); Http.Request request = Http.Request("xyz.com/"); request.data = "Authorization: bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyT3JncyI6WyJESy1UQVUiXSwidXNlcl9uYW1lIjoiREstVEFVLUFETUlOVVNFUiIsInVzZXJMb2NhdGlvbnMiOlt7ImxvY2F0aW9uSWQiOiJESy1UQVUiLCJsb2NhdGlvblR5cGUiOiJkdW1teSJ9XSwibG9jYWxlIjoiZW4iLCJleGNsdWRlZFVzZXJCdXNpbmVzc1VuaXRzIjpbXSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIiwiUk9MRV9hZG1pbkBESy1UQVUiXSwiY2xpZW50X2lkIjoib21uaWNvbXBvbmVudC4xLjAuMCIsInVzZXJUaW1lWm9uZSI6IkV1cm9wZS9Db3BlbmhhZ2VuIiwiZWRnZSI6MCwic2NvcGUiOlsib21uaSIsImNvbXBvbmVudCJdLCJvcmdhbml6YXRpb24iOiJESy1UQVUiLCJhY2Nlc3N0b0FsbEJVcyI6ZmFsc2UsInRlbmFudElkIjoidWJ0c3NkZjExcCIsImV4cCI6MTY0Nzg5NjgxOSwidXNlckRlZmF1bHRzIjpbXSwianRpIjoiOWQ2Nzg3ZDktNjkyMy00OTdhLTk3Y2UtNWJjMTljOWJiNTdmIiwidXNlckJ1c2luZXNzVW5pdHMiOltdfQ.QrKr4V85AP_BZju-GrCVorcn-YgKitWCKCLVcOrGfC4k5Bq9lpeSbzubUn5cape5oC4Qn2fYP53EWisEem0_CGbygZ5G99Y1dtK9xSuI1i4xwePIUxXqCvHkyebeeoAub36pqMGxoWteuGuMgA1hY19KA0gRcZcfVeW6nzJvtz01OFvhSuTZwrnOHg70FCRemZjlmTIblemcBFbQ6Urz8_9xMt9xYSxxm-8PSIJdk_arqjSmVpqSitSemcjtwM8PGEGeTosxK9F3H7soTrz374JGQS6AcE1nVpJkO1dAiooLsCdG3M1xGSdSb_qkepGemPoNornZiFUkS7jOsPnvBg SelectedLocation: aaaa SelectedOrganization: aaaa Content-Length: 49 { \"Query\" : \"IlpnId = 0015700000000500CB60\" } "; Http.Response response = request.sendAndWait(); string json = response.value; Map map = JSON.parse(json); return map;
But this is what I get
My guess is that it will never work because I need the content type to be "application/json" and that is not possible to change I think.
My question is, is it realistical to get this to work using the http.request method or do I need to go the route of doing a direct call via c++?