Re: AngularJS
Pete Helgren <[email protected]>
| Newsgroups | gmane.comp.systems.as400.web |
|---|---|
| Message-ID | <[email protected]> |
Just a thought but you may want to try using Postman and post it that
way. Debug at both ends and maybe something will become obvious.
Postman has saved my bacon a couple of times.
CORS issue maybe? I am trying to think of things I have dealt with in
the past.
Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java
AWS Certified Cloud Practitioner
Microsoft Certified: Azure Fundamentals
Twitter - Sys_i_Geek IBM_i_Geek
On 8/2/2021 12:51 PM, Jay wrote:
> I'm using AngularJS to replace a CGIDEV2 application. So far, it is not working out with the time I've wasted on it.
>
> The $http post doesn't want to pass parms to the RPGLE routines. I can see the routine trying, but the POST variables aren't there.
>
> I have the following:
> var data = {
> pagectl:"LOGIN",
> pagesub1:"VALIDATE",
> username: username,
> password: password
> };
> var config= {
> headers: {"Content-Type": "application/json"}
> };
> $http( { url:'/cgi-bin/wqa0100c',
> method:"POST",
> headers: {"Content-Type": "application/json"},
> data: data
> }
> )
> .success(function(response) {
> console.log(response);
> if( response.status=="OK" ) {
> smn=response.smn;
> slname=response.name;
> } else {
> $rootScope.error=response.errmsg;
> }
> });
>
> The data isn't seen by the RPGLE routine. I can call it from the webbrowser and pass parameters as a GET process, no issue.
> The same chunk of code is running in production now with the CGIDEV2 processes and is access via AJAX.
>
> Any ideas?
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.