Skip to content

In the URL string generated from PxWeb to be used in PxWebApi 2.0 Beta, some character needs to be escaped #663

@KentMossback

Description

@KentMossback

Describe the bug
In the URL string generated from PxWeb to be used in PxWebApi 2.0 Beta, some character needs to be escaped.

To Reproduce
Steps to reproduce the behavior:

  1. Have enableApiV2QueryLink set to true
  2. Make selection for a table and see that some choosen variables contains value codes that needs to be escaped for examle '+',
  3. Scroll down to "API qurey for this table"
  4. Choose to copy the URL string under PxWebApi 2.0 Beta
  5. Get to link adress in for example postman or a web-browser

Expected behavior

Gives values in apiv2Beta

https://api.scb.se/ov0104/v2beta/api/v2/tables/TAB4707/data?lang=sv&valueCodes[Sektor]=030,320,409&valueCodes[Kon]=1,2,1%2B2&valueCodes[ContentsCode]=0000070N,0000070U&valueCodes[Tid]=2024M09

Actual behavior

Gives an error
{
"type": "Parameter error",
"title": "Non-existent value",
"status": 400
}

https://api.scb.se/ov0104/v2beta/api/v2/tables/TAB4707/data?lang=sv&valueCodes[Sektor]=030,320,409&valueCodes[Kon]=1,2,1+2&valueCodes[ContentsCode]=0000070N,0000070U&valueCodes[Tid]=2024M09

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions