This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

REST in Pawn 1.3 - HTTP client for JSON REST APIs (Updated 2021/08/22)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mr05je
New Member
Join Date: Dec 2020
Old 12-03-2020 , 09:31   Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/09/13)
Reply With Quote #1

Hi, i have problem with SSL

Error: POST Error: Cert verify failed: BADCERT_NOT_TRUSTED

I'am trying to send request on localhost and idk how to fix this bug

Code:
JSONObject CreateJSONObject()
{
    JSONObject hJSONObject = new JSONObject();
    hJSONObject.SetString("steamId", "1");

    return hJSONObject;
}

public Action test(int client, int args)
{	
	
    JSONObject hJSONObject = CreateJSONObject();
    HTTPClient hHTTPClient = new HTTPClient("http://localhost:5000/Gang");
    
    hHTTPClient.Post("post", hJSONObject, OnHTTPResponse, 1);
}
P.S.:
I am bad at English, it is difficult for me because I live in Russia

Last edited by mr05je; 12-03-2020 at 09:31.
mr05je is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 12-09-2020 , 08:50   Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/09/13)
Reply With Quote #2

Quote:
Originally Posted by mr05je View Post
Hi, i have problem with SSL

Error: POST Error: Cert verify failed: BADCERT_NOT_TRUSTED

I'am trying to send request on localhost and idk how to fix this bug

Code:
JSONObject CreateJSONObject()
{
    JSONObject hJSONObject = new JSONObject();
    hJSONObject.SetString("steamId", "1");

    return hJSONObject;
}

public Action test(int client, int args)
{	
	
    JSONObject hJSONObject = CreateJSONObject();
    HTTPClient hHTTPClient = new HTTPClient("http://localhost:5000/Gang");
    
    hHTTPClient.Post("post", hJSONObject, OnHTTPResponse, 1);
}
P.S.:
I am bad at English, it is difficult for me because I live in Russia
I can't reproduce this, are you sure you are using http://? You should only need a valid SSL certificate when using https://.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
tball
New Member
Join Date: Jan 2021
Old 01-26-2021 , 04:29   Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/09/13)
Reply With Quote #3

Hi all

I couldn't find any documentation how to do this, and I don't have any experience in libcurl.

How do I change it, so it uses http/2 instead of http/1.1? I have some issue with http/1.1 getting rejected from my API with a chunk error. So I would like to try http/2 instead.

Thank you for this awesome extension.
tball is offline
tball
New Member
Join Date: Jan 2021
Old 01-26-2021 , 05:25   Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2020/09/13)
Reply With Quote #4

Quote:
Originally Posted by tball View Post
Hi all

I couldn't find any documentation how to do this, and I don't have any experience in libcurl.

How do I change it, so it uses http/2 instead of http/1.1? I have some issue with http/1.1 getting rejected from my API with a chunk error. So I would like to try http/2 instead.

Thank you for this awesome extension.
Got it working, by changing the header...
tball is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode