Rest outbound call using authCode and Content-Type application/x-www-form-urlencoded

  • December 9, 2023

x-www-form-urlencoded is not a standard content type for data transmission. You might be referring to application/x-www-form-urlencoded, which is a common content type used when submitting data through HTML forms on the web. It is a way of encoding key-value pairs as a string in the format of key1=value1&key2=value2. 

Steps are as follows. :  

 Create scripted rest api and create a method  

A screenshot of a computer

Description automatically generated

  Override default supported request formats as : application/x-www-form-urlencoded 

Scripted resource as follows :

A screenshot of a computer

Description automatically generated

 can retrieve the urlencoded values provided in the request as a JSON map. You can then supply these urlencoded key-value pairs as query parameters, in the request body, or both. They are combined and stored in the request parameters. Access these parameters through the request.queryParams object. 

Testing : 

A screenshot of a computer

Description automatically generatedWe are getting 200 ok.   

 

 

Blog Post

Related Articles

How Process Automation Can Unleash Your Organisation's Potential

October 11, 2023
Process automation is a transformative force in modern organisations. By streamlining operations, it boosts...

Strategies To Future-Proof Your IT Service Management Infrastructure

October 25, 2023
Developing IT Service Management (ITSM) infrastructure requires investment. It therefore makes sense to do as much as...

Case vs. Incident: The ServiceNow Conundrum - Navigating the ITIL Maze

November 22, 2023
"Why should we use the case instead of logging an incident?”