Re: REST in Pawn - Communicate with JSON REST APIs
Hello!
I'm having a problem with my Post command. My server gets the post JSON data, but the plugin won't execute the function after. I'm calling DoSomething() function in OnPluginStart(). My code: PHP Code:
Does connection have to be https? I get this from my server that the plugin tries to Post so it's working [07/Nov/2017 14:28:09] "POST /api/get_postfromcsgoserver/ HTTP/1.1" 200 98 Thank you! |
Re: REST in Pawn - Communicate with JSON REST APIs
You need to turn off the invernation of the server, or enter to the server.
Quote:
|
Re: REST in Pawn - Communicate with JSON REST APIs
Quote:
|
Re: REST in Pawn - Communicate with JSON REST APIs
Quote:
|
Re: REST in Pawn - Communicate with JSON REST APIs
I Hope that plugin author change to server think and not the game frame
|
Re: REST in Pawn - Communicate with JSON REST APIs
So, i forked this extension 31 oct. 2017, and made small changes.
You can see source code here. Download binaries here. |
Re: REST in Pawn - Communicate with JSON REST APIs
Sorry if this has been asked before, but...
Is there a way to allow the use of self signed SSL certificates? I am getting a BADCERT_CN_MISMATCH error when using a self signed HTTPS URI rest api. Code:
L 07/08/2018 - 19:32:20: [RIPEXT] HTTP request failed: Cert verify failed: BADCERT_CN_MISMATCH |
Re: REST in Pawn - Communicate with JSON REST APIs
Excellent job!
|
Re: REST in Pawn - Communicate with JSON REST APIs
I managed to get the self signed certificate to work - Thanks for helping me out at GitHub.
However, I have another problem... this does not work: Code:
#include <sourcemod> Code:
sm plugins load test Here's another example: Code:
#include <sourcemod> Code:
sm plugins load test |
Re: REST in Pawn - Communicate with JSON REST APIs
Doesn't work
I cannot take value from page |
Re: REST in Pawn - Communicate with JSON REST APIs
New release:
Please let me know if you're still experiencing crashes, as I haven't been able to reproduce them myself. |
Re: REST in Pawn - Communicate with JSON REST APIs
Well, i'm pleased to that you are back to working out on extension. This is really nice extension.
I'm also glad that part of the functionality was taken from my fork. Good job! |
Re: REST in Pawn - Communicate with JSON REST APIs
Guess express was returning 404 for missing a slight slash '/' |
Re: REST in Pawn - Communicate with JSON REST APIs
Hello!
I'm trying to load JSON from a file, but I'm getting an error. Anyone any help? PHP Code:
PHP Code:
File: PHP Code:
|
Re: REST in Pawn - Communicate with JSON REST APIs
Thanks slekenda, this should be fixed in 1.0.6.
|
Re: REST in Pawn - Communicate with JSON REST APIs
1 Attachment(s)
I need to get value of total_time_played Result PHP Code:
|
Re: REST in Pawn - Communicate with JSON REST APIs
I created simple debugging script in PHP for check if rest in pawn sending POST data to target HTTP but can't see any POST data in apache logs i see request from my csgo server.
Debugging script: PHP Code:
Code:
[[],[],[]] PHP Code:
|
Re: REST in Pawn - Communicate with JSON REST APIs
Hey. I'm trying to read a json object that has a unknown number of values with the function GetString(). As the .inc file says it is suposed to return false on invalid index but it is causing a exception intead.
|
Re: REST in Pawn - Communicate with JSON REST APIs
Maybe someone can compile this extension with github request included. Extension really great, but missing HasKey method.
|
Re: REST in Pawn - Communicate with JSON REST APIs
Thank You For This
|
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
New release:
|
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
What is curl "-u" representation
|
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
|
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
Quote:
I think this type of authorization can't be set in header. I tried to set authorization basic as header but this isn't working. |
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
So you base64-encoded "username:password" and appended the result after "Basic ", as explained on the page I linked?
Edit: seems to work. PHP Code:
|
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
After encode keys auth works correctly. Thanks for help and sorry for waste time
|
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
Awesome.
Could you make the Amxx version for CS 1.6? |
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2019/12/28)
For AMXX you might can use gRIP (GoldSrc REST in Pawn). https://github.com/In-line/grip
|
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2020/03/24)
Hi DJ Tsunami
Firstly many thanks for making this extension. It is fantastic! Back in 2017 you mentioned that JSONObject iteration was not possible. I am wondering if this is still the case? Here is an example of what I'm trying to do: PHP Code:
How would I go about this? Is it possible to retrieve an array of keys from a JSONObject? Alternatively is it possible to extract the keys in a similar fashion to StringMaps, via StringMapSnapshot.GetKey(index)? Thanks a lot |
Re: REST in Pawn 1.1 - HTTP client for JSON REST APIs (Updated 2020/03/24)
It's still not possible, but your use case is legitimate, so I'll look into it.
|
Re: REST in Pawn - Communicate with JSON REST APIs
Quote:
i got same error like this.. i got null response.Data and i got empty json on my web server.. i tried to use api tester and its working fine so it should be my sourcemod plugin |
Re: REST in Pawn - Communicate with JSON REST APIs
Quote:
The request Content-Type is application/json instead of application/x-www-form-urlencoded. PHP Code:
|
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/06/21)
New release:
|
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/06/21)
Quote:
|
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/06/21)
Version 1.2.0 did not properly clean up requests, please update to version 1.2.1.
1.2.1 also adds support for 64-bit integers in JSON, thanks to Gunslinger. |
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/07/16)
After uploading a file, should we close the handle or is that done automatically?
Code:
void OnImageUploaded(HTTPStatus status, any value) |
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/07/16)
No, if your HTTP client is defined globally, there's no reason to delete it. You can just reuse it for future requests.
|
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/07/16)
Is there anyway to get the file that was uploaded in "OnImageUploaded". You can pass a value, but you cant pass a string (unless i'm missing something here).
|
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/07/16)
You can pass a DataPack as value with any data you want.
|
Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/07/16)
Minor update:
|
All times are GMT -4. The time now is 12:59. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.