NetTalk Central

Author Topic: x-www-form-urlencoded and queues  (Read 3407 times)

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
x-www-form-urlencoded and queues
« on: April 22, 2019, 11:43:25 AM »
Hi Bruce:
  Got a question related to API services using queues. Today, a client try to consume a call that have a queue list for some procedures, and by error he was sending the request as x-www-form-urlencoded. The queue has the validation check mark always required, but when i check the logs, the queue is not parsed (check the constructed call bellow). I did try to make the same call using Postman, and it fails. Any suggestions?  The rest of the packet was inserted in the DB.

The client after all, change his request to app/json and all works fine, but what trouble me is, if the api can not receive nothing in the queue, it is supposed to send back an error, and wasn't happening. He was using TypeScript to make the calls.

Thank you in advance
@ Urayoan

AccountNumber:1470431
PatientNumber:0
QuoteDate:22/04/2019
QuoteTime:03:45PM
RefDoctorNumber:106
Procedures[0][LineNumber]:1
Procedures[0][ProcNumber]:3747
Procedures[0][QtyProcedures]:1
Procedures[0][InvoiceCodeINT]:0
Procedures[1][LineNumber]:2
Procedures[1][ProcNumber]:5550
Procedures[1][QtyProcedures]:1
Procedures[1][InvoiceCodeINT]:0
token:My_Very_long_Token

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11193
    • View Profile
Re: x-www-form-urlencoded and queues
« Reply #1 on: April 23, 2019, 06:36:02 AM »
I need an example to comment Ura, but of course you can't really get a queue in form-encoded format. At _best_ you might get 1 record, and I'm not even sure it does that.

cheers
Bruce

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: x-www-form-urlencoded and queues
« Reply #2 on: April 25, 2019, 09:56:03 AM »
Ok Bruce, here we go. Lets see how it goes. Using Postman this is the JSON package that i send and insert data

{
  "QuoteID" : "1",
  "AccountNumber" : "1",
  "PatientNumber" : "0",
  "QuoteDate" : "04/25/2019",
  "QuoteTime" : "01:31PM",
  "RefDoctorNumber" : "109",
  "Procedures" : [
    {
      "LineNumber" : 1,
      "ProcNumber" : 6025,
      "QtyProcedures" : 1
    }
  ],
  "token" : "value"
}

For what i read and understood, the equivalent in form-urlencoded is this (bulk edit to make it fast)

QuoteID:1
AccountNumber:1
PatientNumber:0
QuoteDate:04/25/2019
QuoteTime:01:31PM
RefDoctorNumber:109
Procedures[0]LineNumber[0]:1
Procedures[0]ProcNumber[0]:6025
Procedures[0]QtyProcedures[0]:1
Procedures[1]LineNumber[1]:1
Procedures[1]ProcNumber[1]:6026
Procedures[1]QtyProcedures[1]:1
token:my_very_long_token

The reference was taken from here
https://medium.com/@darilldrems/how-to-send-arrays-with-get-or-post-request-in-postman-f87ca70b154e