Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / HTTP Commands - Can I see The URL That is Being Submitted?

Author
Message
JHAustin
User Banned
Posted: 28th Sep 2020 22:00
Hello All,

I have a project using a Rest API that I have had success doing in JAVA and I wanted to see if AppGameKit could handle it too.
I have X'd out the sensitive fields, in this Code Snippet:



The first comment shows a URL that if put directly into a browser shows a valid JSON response, but when trying to submit it through AppGameKit, I just get an Error.
I did X out the part of the URL that contains sensitive data, so that link will not pull the data, but if I substitute the correct values, it will.
The MID$ and AccessCode$ variables are the holders of that information.

I think, that all I really need to see is what URL is AppGameKit creating, so I can see where the error is.

Is there any way to see the resulting URL that AppGameKit is submitting, or am I just going about it the wrong way entirely?

Thank you,
Joe
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 29th Sep 2020 11:17
What you're doing wrong is with the 'SendHTTPRequestASync(http, "/v3/merchants/", vars$)' line. You're sending part of the request header (var$) as the body of the message.

This is fine and normal for your typical RESTful API endpoint, where sending a JSON as the request - that will need be in the body of the message. However, since that API of yours have the query all in the URL field, you'd want to do something like this:



Notice no starting forward-slash in the query.
JHAustin
User Banned
Posted: 29th Sep 2020 16:18
Thank you for responding Dybing. I made the changes, as you suggested, but I am still getting an error.



I will keep plugging away at it. I have used the HTTP commands in AppGameKit successfully before, with a different API, so I'm sure it is just something I am overlooking.

Thanks again,
Joe
JHA
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location: Massachusetts, USA
Posted: 29th Sep 2020 16:23 Edited at: 29th Sep 2020 16:31
Just so the MODs are aware, since my posts are being held for approval, JHAustin is a new profile for me, as of last year. I haven't posted much with it, but I am not a newbie.
I tried to change my email address and ended up creating a whole new profile, so I pretty much just use the new one now.

I realize that the approval wait time will go away with continued posts, so no big deal, just making people aware.

Thank you,
Joe
Abiz
11
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 3rd Oct 2020 16:01 Edited at: 3rd Oct 2020 16:01
This should help you


Straight from our working code.
2D Analyst
AGK Developer
19
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 22nd Oct 2020 05:23
Are you using post or get on server side?
I got it working using post.

Login to post a reply

Server time is: 2024-03-29 12:38:47
Your offset time is: 2024-03-29 12:38:47