REST API using POST for getting data

Hi Guys

I am struggling with setting up a connection to an API which uses the POST method for getting data and not the GET. Looks like Appgyver is set up differently than what this API expects.

There are three things to send in the body, 2 static values and 1 from a variable out of the app.

Thanks for the insights. If you have an idea, try to explain it to me in easy words since I am not a programmer.


Hey @Andreas_Niedermann
Please, tell me which API you are using.


Hi @Fernando_Oliveira

Thanks for your answer. We are running an api by ourselves in combination with our iOS and Android app. Check out the screenshot. That’s working when using an API test program on my Mac.

I am trying to create a simple Appgyver app for support purposes.

Thanks for your help

Hey @Andreas_Niedermann
Sorry, but please show me the settings in Appgyver and the error displayed by it.


Error: TypeError: Preflight response is not successfulstatus: -1

because Appgyver uses GET but I need to query the server with POST


Does this mean parameters to retain certain type of information or what do you want to record/save this information?

I’m a little confused so let’s forget for a moment the HTTP Get and POST “verbs”. Objectively, what do you want to do: save information or get information?
Additionally, please replicate the settings made in the “DATA CONFIGURATOR” option of AppGyver. You are doing this, right?
Lastly, please explain to me the “GetAppUser” in your URL.


I would like to use the GET DATA COLLECTION from AppGyver but not use the GET but the POST method for it, since the API requires it to query information. I would like to query the API and get information from it.

The API doesn’t accept GET where all parameters are sent in the URL but it requires the parameters sent in the body with the basic http authorization sent in the header.



basic http authorization

parameter1 = static
parameter2 = static
UserId = variable

When doing this post with the UserId X I get in return a json with numerous infos about the User X

In AppGyver I would like to use the GET COLLECTION (GET), run the test and SET SCHEMA FROM RESPONSE

Hope now it is more clear what I am trying to do.

Hey @Andreas_Niedermann

First, let’s try this approach and see what happens :slight_smile:

Step 1

Step 2

Step 3

Step 4

Good luck!


Thanks for all the work. I did exactly as you asked but still get

Error: TypeError: Preflight response is not successfulstatus: -1

Hey @Andreas_Niedermann

Okay. But don’t be discouraged :slight_smile:
This error message may also be related to IIS settings. So see this technical article (IIS Team Blog - Getting started with the IIS CORS Module). He can help resolve this situation. It will most likely be necessary to add other elements to HEADER for use through AppGyver.

Good luck.

Hi @Fernando_Oliveira yeah, thats probably the issue.

In the Web.config I found this

   <compilation targetFramework="4.0" />
   <customErrors mode="Off" />
     <deny users="*" />

Problably that’s the issue

1 Like

Hi @Fernando_Oliveira

I am getting nowhere here sadly. I activated CORS on our IIS6.2 but still can’t access our API from Appgyver.

Any idea left?

Hey @Andreas_Niedermann

Try adding to the header:
Access-Control-Request-Headers: additional-header


@Fernando_Oliveira got a little further. We have indeed IIS8 on our server and that needs an extension to be installed for CORS.

Now I have set up CORS in Web.config

    <cors enabled="true"> 
<add origin=""  allowCredentials="true"/>

Appgyver now gives me back a different error message:

Error: TypeError: Request header field Content-Type is not allowed by Access-Control-Allow-Headers.status: -1

Any idea what’s left?

Hey @Andreas_Niedermann

Try this now:

<add origin=""  allowCredentials="true"/>
            <add method="GET" />
            <add method="POST" />

What values are you passing in the DATA CONFIGURATOR → BASE–>HTTPHeader?
Can you make the API call through the browser?

You can try that too…

    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
    <add name="Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT" />

@Fernando_Oliveira thanks a lot for your patience it worked now!

Hey @Andreas_Niedermann

Congratulations! I’m really glad you made it. I never give up and apparently you don’t either!
A hug and keep going! :clap: