API CONNECT - WEBREQUEST PROBLEM

Other 統合 MySQL PHP

仕事が完了した

実行時間17 時間
開発者からのフィードバック
A great experience. I'd be happy to work with you again.
依頼者からのフィードバック
Vitor did an excellent job and quickly. He is also a person who can express himself very well and this facilitated the completion of the project. I wholeheartedly recommend this developer.

指定

Hello!


I'm having trouble putting together the code to connect to a database and control a query.

I created this code through some queries but I have an error when complicating code 4029.


void Check()

  {

   string uri = "END_POINT_API";

   char post[100];

   char result1[100];

   string headers;

   string APIKEY = "";

   string LICENCEKEY = "";

   int res;

   string signal = "?api_key=" + APIKEY + "&license_key=" + LICENSEKEY;

   StringToCharArray(signal, post);


// Construct the request headers

   headers = "Content-Type: application/json";  // Set the correct header format


// Reset last error

   ResetLastError();


// Post data to REST API

   res = WebRequest(

            "POST",

            uri,

            headers,        // Pass headers as a string

            10,             // Timeout in seconds

            post,

            result1,        // Store the response in result1

            headers         // Response headers (optional)

         );


// Check errors

   if(res == -1)

     {

      int error_code = GetLastError();

      string error_msg = ErrorDescription(error_code);

      Print("Error in Webquest. Error Code ",error_code," Error ",error_msg);

      if(error_code==4060)

        {

         MessageBox("Add address '"+uri+"' in Expert Advisors tab of the Options window", "Error", MB_ICONINFORMATION);

        }

      else

        {

         // Successful

         Print("REST client's POST: ", signal);

         Print("Server response: ", CharArrayToString(result1, 0, -1));

        }

     }

  }

//+------------------------------------------------------------------+


Below is the documentation of the API in which I want to query and with the result I will search for some information to validate the license of my products.



It is important to mention that I inserted my end-point in the metatrader 4 options, ruling out that this is why the connection problem occurred.



応答済み

1
開発者 1
評価
(42)
プロジェクト
49
47%
仲裁
1
100% / 0%
期限切れ
1
2%
パブリッシュした人: 1 code
2
開発者 2
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
3
開発者 3
評価
(19)
プロジェクト
27
26%
仲裁
2
0% / 100%
期限切れ
2
7%
4
開発者 4
評価
(26)
プロジェクト
34
29%
仲裁
0
期限切れ
1
3%
5
開発者 5
評価
プロジェクト
0
0%
仲裁
0
期限切れ
0
類似した注文
Early Killer EA 30+ USD
It must have automated stop loss. Something that can end poverty and kill the market early.It must take the trades for me whenever I start it it must work on tradeport ea

プロジェクト情報

予算
30+ USD