NetTalk Central

Author Topic: Rest API - bad request reply  (Read 2074 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Email
Rest API - bad request reply
« on: December 29, 2024, 03:25:36 AM »
Hi,

In doing a Post to Postmark email API I get the following response.
My JSON data seems to check out OK using a validator.

Is there a way I can save the header of my post?

I know using ThisPage gives me the returned page , header and all, but is there a similar function for the POST?

thanks
Johan



HTTP/1.1 400 Bad Request
Date: Sat, 28 Dec 2024 16:20:00 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 80
Connection: keep-alive
vary: Origin
Strict-Transport-Security: max-age=16000000;

{
  "message":"Bad request",
  "request_id":"fbeaeb7a31e4f17056304f6400604e28"
}

Jane

  • Sr. Member
  • ****
  • Posts: 381
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: Rest API - bad request reply
« Reply #1 on: December 29, 2024, 11:33:36 AM »
Johan,

As a first suggestion, try compiling with
Code: [Select]
NetShowSend=>1and then using debugview++

Another tool I've found useful is to run Fiddler and use it to monitor traffic in and out.  If you have an app (Postman, maybe?) that works and one that doesn't, that can be useful to compare what the two different apps are sending.

JohanR

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Email
Re: Rest API - bad request reply
« Reply #2 on: December 29, 2024, 01:07:28 PM »
Hi Jane

Thanks!!
NetShowSend=>1 did the trick

Could see immediately that I made hash of the lookups in my config file for my header settings, custom header etc...


cheers,

Johan