Skip to content

Serialize composite []string with empty square brackets #27

@Integralist

Description

@Integralist

👋🏻 I have an API that expects data to be sent like so:

services[]=A&services[]=B

How can I achieve this?

Currently the default behaviour appears to number each element within the slice.

I see there's a DelimitWith method but that doesn't quite achieve what I need (e.g. DelimitWith('|')):

services|0=A&services|1=B

Is there a custom unmarshal method I can define that might help encode the data how I need it?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions