[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Return code 201 returned as error?



I do not have a full understanding of 201-a resource was created before returning successfully

From my brief investigation I tend to agree that a 201 should not generate an escape message.

 


Don Brown

 

Inactive hide details for "Scott Klement" ---25/05/2018 07:25:53 AM---Hi Marina, The reason HTTPAPI returns an "error" on respo"Scott Klement" ---25/05/2018 07:25:53 AM---Hi Marina, The reason HTTPAPI returns an "error" on response code 201 is because

From: "Scott Klement" <sk@xxxxxxxxxxxxxxxx>
To: "FTPAPI/HTTPAPI mailing list" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Date: 25/05/2018 07:25 AM
Subject: Re: [Ftpapi] Return code 201 returned as error?
Sent by: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx




Hi Marina,

The reason HTTPAPI returns an "error" on response code 201 is because 201 means something different from 200.   200 is the "normal" response meaning that everything was received correctly, but 201 means that a resource was created before returning successfully.  HTTPAPI wants to make that clear so that your application can make the distinction between 200 and 201 in case it matters to you.

Perhaps http_string/http_stmf should not send an escape message in that case, though?  That would probably be more intuitive. I think I'll change that.

Would this change cause any problems for anyone reading this list?

-SK


On 5/24/18 1:15 PM, Marina Schwenk wrote:

    Hi Scott,
    I am using the latest version of HTTPAPI and my web service call is returning 201 which is getting caught in my monitor block and I am not getting the json response because of it.
     
    I can’t quite see what I am doing wrong?
     
    This is calling a web service controller built in Java to call fedex.
     
    Code:
                    Url ="" http://localhost:53226/shipping/fedex/close                           
           monitor;
               responseJson = http_string( 'POST' : url : requestJson );
           on-error;
               error =  http_error();
     
               evblog_log( SHIPPING_EVBLOG_APPNAME
                            : PROGRAM_NAME
                            : PROCEDURE_NAME
                            : EVBLOG_INFORMATION
                            : 'Http call'
                            : error   );
           endmon;                                  
     
    Can you see what I am doing wrong?
    I appreciate any help you can give!
     
    Thank you,
    Marina Schwenk 




______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit
http://www.symanteccloud.com
______________________________________________________________________

--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi


GIF image

-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi