Request FW WEBSERVICE

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Request FW WEBSERVICE

Postby Otto » Tue Oct 05, 2021 3:35 pm

Dear Antonio,
I try to reach the mod harbour websercice.

http://www.modharbour.org/modharbour_sa ... ervice.prg

But my program errors out.

Can you please help me?
Best regards,
Otto

[ 2] = U nil
called from: CHARACTER:__OPPLUS, line: 0
called from: ..\source\exec.prg, INLINEPRG, line: 103
called from: pcode.hrb, MAIN, line: 53
called from: HB_HRBDO, line: 0
called from: ..\source\exec.prg, EXECUTE, line: 70


Code: Select all  Expand view


#define HB_CURLOPT_POST                      47
#define HB_CURLOPT_URL                        2
#define HB_CURLOPT_DL_BUFF_SETUP              1008
#define HB_CURLOPT_POSTFIELDS                 15


function main()
   
    TEMPLATE
        <!DOCTYPE html>
        <html lang="en">
        <head>
            <meta charset="UTF-8">
            <title>Basic test CURL mod_harbour</title>
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
            <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.css"/>
        </head>
        <body>
        <div class="container">
            <div class="row">
               <h1>Basic test CURL mod_harbour</h1>

                <div class="col-sm-12">

               <?prg

               local uValue

               curl_global_init()
           
               if ! empty( hCurl := curl_easy_init() )
               curl_easy_setopt( hCurl, HB_CURLOPT_POST, 1 )
               curl_easy_setopt( hCurl, HB_CURLOPT_URL, "http://www.modharbour.org/modharbour_samples/webservice.prg" )
               curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP )
               curl_easy_setopt( hCurl, HB_CURLOPT_POSTFIELDS, hb_jsonEncode( { "key1" => "value1", "key2" => "value2", "key3" => "value3" } ) )
           
                    if curl_easy_perform( hCurl ) == 0
                       uValue = curl_easy_dl_buff_get( hCurl )
                    endif
               endif
           
               curl_global_cleanup()

               ?>

                <div>
            </div>
        </div>
        </body>
        </html>
    ENDTEXT

return NIL

//----------------------------------------------------------------------------------------//


 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6045
Joined: Fri Oct 07, 2005 7:07 pm

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 2 guests