Webservices

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Krish93
    New Member
    • Nov 2018
    • 5

    Webservices

    I got a web service API. I know basic knowledge web services. I am trying to test the web service through the postman. but I could not able to succeed. if any have answer please help me. I got sample code nodejs. below I gave web services API. please, anyone, see and how to handle that data.

    Code:
     POST /api/v1/sessions
    Date: Wed, 28 Nov 2018 06:22:27 -0000
    Content-Type: application/json;charset=utf-8
    Content-MD5: wQsVzvcXwtwzoiZ13iAVWA==
    
    {
        "password": "sym", 
        "username": "sym"
    }
    they gave their own json commander tools. if I send this request in JSON commander it is giving the proper response.if I use the same request. I tested by the postman.it is not working. and getting this error response also

    Code:
    {
      "status" : 400,
      "code" : 40001,
      "resource" : null,
      "properties" : [ ],
      "message" : "The Date header is invalid.",
      "developerMessage" : "The Date header is invalid. Make sure that a the Date or X-Aah-Date header is set and has a valid format."
    }
    Attached Files
    Last edited by zmbd; Apr 18 '22, 10:57 AM. Reason: [z{placed code format}]
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    You should read the error message, and try to understand what is meant with that.

    Especially the line: "The Date header is invalid ..."


    P.S. Its meaning is that the header (the one with 'Date:....') has an invalid date.

    Comment

    • Krish93
      New Member
      • Nov 2018
      • 5

      #3
      Do you know how to set data header

      Comment

      • Luuk
        Recognized Expert Top Contributor
        • Mar 2012
        • 1043

        #4
        Do you have more info on which tool you are using? I do not know a tool called 'Jason Commander' (from the image you posted.)

        Comment

        • Krish93
          New Member
          • Nov 2018
          • 5

          #5
          I want to same request use through postman tools.is it possible

          Comment

          • Luuk
            Recognized Expert Top Contributor
            • Mar 2012
            • 1043

            #6
            Maybe you should read a turorial first?

            try: https://steelkiwi.com/blog/api-testi...ial-and-hints/

            Comment

            • Krish93
              New Member
              • Nov 2018
              • 5

              #7
              My Date format wrong order. I want this format date and time Monday, 03-December-18 07:41:29 UTC.. how to do postman. Postman time zone time differ. I need this time zone. anyone can help me

              Comment

              • Luuk
                Recognized Expert Top Contributor
                • Mar 2012
                • 1043

                #8
                The valid options for this Date in het header of an HTTP message are described in some RFC's.

                Chapter 14.8 (https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)
                The Date general-header field represents the date and time at which the message was originated, having the same semantics as orig-date in RFC 822. The field value is an HTTP-date, as described in section 3.3.1; it MUST be sent in RFC 1123 [8]-date format.
                Date = "Date" ":" HTTP-date
                An example is
                Date: Tue, 15 Nov 1994 08:12:31 GMT


                chapter 5.2.14 (https://tools.ietf.org/html/rfc1123#page-55)



                That's why you should not change the date format wich is used in the header of a HTTP message.

                Comment

                Working...